add root timeout

This commit is contained in:
Jakobus Schürz 2020-03-12 10:32:37 +01:00
parent b7d3bd3023
commit d68a65338f

View file

@ -11,6 +11,7 @@ if [[ $- = *i* ]] ; then
#echo "interactive shell" >&2
# define variables
[ -z "${MYSHELLCONFIIG_ROOT_TMOUT+x}" ] && MYSHELLCONFIIG_ROOT_TMOUT=0
[ -z "${USERNAME+x}" ] && USERNAME="$USER"
[ -z "${USEREMAIL+x}" ] && USEREMAIL="$USER@$(domainname -f)"
[ -z "${FULLNAME+x}" ] && FULLNAME="$(getent passwd $USER | cut -d ":" -f 5 | cut -d ',' -f 1)"
@ -32,6 +33,8 @@ if [[ $- = *i* ]] ; then
SGIT="git -C ${MYSHELLCONFIG_BASE}"
export MYSHELLCONFIG_BASE MYSHELLCONFIG_LOGDIR MYSHELLCONFIG_LOGFILE SGIT MYSHELLCONFIG_VIM_PLUGINS
# if we are root, exit after 5 Minutes
[ $( id -u ) -eq 0 ] && TMOUT=${MYSHELLCONFIIG_ROOT_TMOUT}
cat << EOF >> "${MYSHELLCONFIG_LOGFILE}"
------- start -------------- $(date) ---------------8<--