Update powerwall.sh
This commit is contained in:
@@ -343,13 +343,19 @@ STARTALL_SERVICES(){
|
|||||||
/bin/systemctl start $srvc
|
/bin/systemctl start $srvc
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
STOP_SERVICE(){
|
STOP_SERVICE(){
|
||||||
echo "stop: ${1}"
|
echo "stop: ${1}"
|
||||||
service_pid=`systemctl show --property MainPID --value ${POWERWALL_SERVICES[${1}]}`
|
service_pid=`systemctl show --property MainPID --value ${POWERWALL_SERVICES[${1}]}`
|
||||||
/usr/bin/pkill -P $service_pid
|
/usr/bin/pkill -P $service_pid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CHECK_SERVICES(){
|
||||||
|
for srvc in "${POWERWALL_SERVICES[@]}"; do
|
||||||
|
echo -en "${POWERWALL_SERVICES[${srvc}]} ... "
|
||||||
|
[ "$(systemctl is-active ${POWERWALL_SERVICES[${srvc}]})" == "active" ] && echo "Running" || "Not Running"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
SHUTDOWN_MAIN(){
|
SHUTDOWN_MAIN(){
|
||||||
SHUTDOWN_SERVERS MAIN
|
SHUTDOWN_SERVERS MAIN
|
||||||
echo
|
echo
|
||||||
@@ -539,6 +545,7 @@ fi
|
|||||||
stopall) STOPALL_SERVICES;;
|
stopall) STOPALL_SERVICES;;
|
||||||
startall) STARTALL_SERVICES;;
|
startall) STARTALL_SERVICES;;
|
||||||
restartall) RESTART_SERVICES;;
|
restartall) RESTART_SERVICES;;
|
||||||
|
check-services) CHECK_SERVICES;;
|
||||||
checktemp) CHECKTEMP ${2};;
|
checktemp) CHECKTEMP ${2};;
|
||||||
checkpower) CHECKPOWER;;
|
checkpower) CHECKPOWER;;
|
||||||
test) TEST ${2};;
|
test) TEST ${2};;
|
||||||
|
|||||||
Reference in New Issue
Block a user