implementato comandi e socket server api per lo spengimento e riavvio del sistema. Corretto problema che lasciava sul sistema file di appoggio per i messaggi da inviare tramite socket server

This commit is contained in:
lejubila
2017-09-10 12:44:35 +02:00
parent 59b27365ed
commit e64f651cab
5 changed files with 55 additions and 4 deletions

View File

@@ -205,6 +205,20 @@ function socket_server_command {
;;
reboot)
message_write "warning" "System reboot is started"
json_status
local PATH_SCRIPT=`$READLINK -f "$DIR_SCRIPT/$NAME_SCRIPT"`
nohup $PATH_SCRIPT reboot > /dev/null 2>&1 &
;;
poweroff)
message_write "warning" "System shutdown is started"
json_status
local PATH_SCRIPT=`$READLINK -f "$DIR_SCRIPT/$NAME_SCRIPT"`
nohup $PATH_SCRIPT poweroff > /dev/null 2>&1 &
;;
*)
json_error 0 "invalid command"
;;