reboot-LXC-host.sh: logoff user from System.
This commit is contained in:
parent
a01eb8abd5
commit
08b015c55d
@ -25,24 +25,6 @@ declare -a lx_running_container_arr=()
|
|||||||
|
|
||||||
clean_up() {
|
clean_up() {
|
||||||
|
|
||||||
|
|
||||||
if [[ -f "$_backup_crontab_file" ]]; then
|
|
||||||
|
|
||||||
blank_line
|
|
||||||
echononl " (Re)Install Crontab from previously saved crontab file
|
|
||||||
'$_backup_crontab_file'.."
|
|
||||||
|
|
||||||
crontab $_backup_crontab_file >> $log_file 2>&1
|
|
||||||
|
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
echo_ok
|
|
||||||
else
|
|
||||||
echo_failed
|
|
||||||
error "$(cat $log_file)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Perform program exit housekeeping
|
# Perform program exit housekeeping
|
||||||
rm -f $log_file
|
rm -f $log_file
|
||||||
rm -rf /tmp/*.${random_prefix}
|
rm -rf /tmp/*.${random_prefix}
|
||||||
@ -305,7 +287,43 @@ if $terminal ; then
|
|||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
/sbin/reboot -f
|
#runWithDelay () {
|
||||||
|
# sleep $1;
|
||||||
|
# shift;
|
||||||
|
# "${@}";
|
||||||
|
#}
|
||||||
|
#runWithDelay 5 /sbin/reboot -f &
|
||||||
|
|
||||||
|
#run_with_delay() {
|
||||||
|
# sleep $1; "${@:2}"
|
||||||
|
#}
|
||||||
|
#run_with_delay 10 /sbin/reboot -f &
|
||||||
|
|
||||||
|
|
||||||
|
nohup bash -c 'sleep 5; /sbin/reboot -f' > /dev/null 2>&1 &
|
||||||
|
|
||||||
|
_which_command="$(which pkill)"
|
||||||
|
|
||||||
|
if [[ "${_which_command}" = "/usr/bin/pkill" ]]; then
|
||||||
|
|
||||||
|
#who | awk '!/root/{ cmd="/usr/bin/pkill -KILL -u " $1; system(cmd)}'
|
||||||
|
who | awk '$1 !~ /root/{ cmd="/usr/bin/pkill -KILL -u " $1; system(cmd)}'
|
||||||
|
|
||||||
|
elif [[ "${_which_command}" = "/usr/sbin/pkill" ]]; then
|
||||||
|
|
||||||
|
#who | awk '!/root/{ cmd="/usr/sbin/pkill -KILL -u " $1; system(cmd)}'
|
||||||
|
who | awk '$1 !~ /root/{ cmd="/usr/sbin/pkill -KILL -u " $1; system(cmd)}'
|
||||||
|
|
||||||
|
elif [[ "${_which_command}" = "/sbin/pkill" ]]; then
|
||||||
|
|
||||||
|
#who | awk '!/root/{ cmd="/sbin/pkill -KILL -u " $1; system(cmd)}'
|
||||||
|
who | awk '$1 !~ /root/{ cmd="/sbin/pkill -KILL -u " $1; system(cmd)}'
|
||||||
|
|
||||||
|
elif [[ "${_which_command}" = "/bin/pkill" ]]; then
|
||||||
|
|
||||||
|
#who | awk '!/root/{ cmd="/bin/pkill -KILL -u " $1; system(cmd)}'
|
||||||
|
who | awk '$1 !~ /root/{ cmd="/bin/pkill -KILL -u " $1; system(cmd)}'
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
clean_up 0
|
clean_up 0
|
||||||
|
Loading…
Reference in New Issue
Block a user