This commit is contained in:
2024-11-09 05:48:46 -07:00
parent c7d949e2dd
commit 0811396479
+9 -7
View File
@@ -1,6 +1,4 @@
#!/bin/bash #!/bin/bash
startTime=$(date '+%s')
# testing: # testing:
# rm ~/esp/install.log; rm ~/esp/version-data.txt; ls ~/esp; bash ~/esp/esp-install-custom/cron-reinstall-esp-idf.sh # rm ~/esp/install.log; rm ~/esp/version-data.txt; ls ~/esp; bash ~/esp/esp-install-custom/cron-reinstall-esp-idf.sh
# tail -f -n 50 ~/esp/install.log # tail -f -n 50 ~/esp/install.log
@@ -9,7 +7,9 @@ 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=45-major # version of this script startTime=$(date '+%s')
cronVers=46-major # version of this script
log=$HOME/esp/install.log log=$HOME/esp/install.log
@@ -27,16 +27,18 @@ function write_to_log() {
} }
if [ "$1" == "test" ]; then if [ "$1" == "test" ]; then
sleepMins=0; write_to_log "$(date '+%d/%m/%Y %H:%M:%S %Z (%s)'): test mode"
rm ~/esp/install.log sleepMins=0
rm ~/esp/version-data.txt rm -f $HOME/esp/install.log
ls ~/esp rm -f $HOME/version-data.txt
ls $HOME/esp
function logout_all_users() { function logout_all_users() {
return 0 return 0
} }
else else
sleepMins=3 # minutes of warning to wait for user to log out sleepMins=3 # minutes of warning to wait for user to log out
function logout_all_users() { function logout_all_users() {
who | sudo awk '$1 !~ /root/{ cmd="/usr/bin/pkill -KILL -u " $1; system(cmd)}' who | sudo awk '$1 !~ /root/{ cmd="/usr/bin/pkill -KILL -u " $1; system(cmd)}'
return $? return $?