unset TMOUT if not in TTY
This commit is contained in:
parent
0c48b14a87
commit
2dab903886
1 changed files with 2 additions and 3 deletions
|
@ -3,8 +3,6 @@
|
||||||
# if we are root, exit after 5 Minutes
|
# if we are root, exit after 5 Minutes
|
||||||
case $(tty) in
|
case $(tty) in
|
||||||
/dev/tty[0-9]*)
|
/dev/tty[0-9]*)
|
||||||
#[ $( id -u ) -eq 0 ] && TMOUT=${MYSHELLCONFIG_ROOT_TMOUT}
|
|
||||||
#[ $( id -u ) -gt 0 ] && TMOUT=${MYSHELLCONFIG_USER_TMOUT}
|
|
||||||
case $(id -u) in
|
case $(id -u) in
|
||||||
0)
|
0)
|
||||||
TMOUT=${MYSHELLCONFIG_ROOT_TMOUT:-500}
|
TMOUT=${MYSHELLCONFIG_ROOT_TMOUT:-500}
|
||||||
|
@ -16,7 +14,8 @@ case $(tty) in
|
||||||
echo "Run in TTY -> set autologout \$TMOUT=$TMOUT" >&2
|
echo "Run in TTY -> set autologout \$TMOUT=$TMOUT" >&2
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Run in other terminal" >&2
|
echo "Run in other terminal - set no autologout" >&2
|
||||||
|
unset TMOUT
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue