45-major
This commit is contained in:
@@ -9,8 +9,8 @@ startTime=$(date '+%s')
|
|||||||
# crontab -e
|
# crontab -e
|
||||||
# 0 8 * * * bash $HOME/esp/esp-install-custom/cron-reinstall-esp-idf.sh
|
# 0 8 * * * bash $HOME/esp/esp-install-custom/cron-reinstall-esp-idf.sh
|
||||||
|
|
||||||
cronVers=42-live # version of this script
|
cronVers=45-major # version of this script
|
||||||
sleepMins=3 # minutes of warning to wait for user to log out
|
|
||||||
log=$HOME/esp/install.log
|
log=$HOME/esp/install.log
|
||||||
|
|
||||||
myUser=$USER
|
myUser=$USER
|
||||||
@@ -26,10 +26,22 @@ function write_to_log() {
|
|||||||
echo -e "$1" >> $log
|
echo -e "$1" >> $log
|
||||||
}
|
}
|
||||||
|
|
||||||
function logout_all_users() {
|
if [ "$1" == "test" ]; then
|
||||||
who | sudo awk '$1 !~ /root/{ cmd="/usr/bin/pkill -KILL -u " $1; system(cmd)}'
|
sleepMins=0;
|
||||||
return $?
|
rm ~/esp/install.log
|
||||||
}
|
rm ~/esp/version-data.txt
|
||||||
|
ls ~/esp
|
||||||
|
|
||||||
|
function logout_all_users() {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sleepMins=3 # minutes of warning to wait for user to log out
|
||||||
|
function logout_all_users() {
|
||||||
|
who | sudo awk '$1 !~ /root/{ cmd="/usr/bin/pkill -KILL -u " $1; system(cmd)}'
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
sleepSecs=$((sleepMins*60)) # calculated seconds of warning to wait for user to log out
|
sleepSecs=$((sleepMins*60)) # calculated seconds of warning to wait for user to log out
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user