This commit is contained in:
2022-09-11 21:40:28 -05:00
parent 8838981089
commit fe14f1dc50
2 changed files with 22 additions and 21 deletions

View File

@@ -198,10 +198,23 @@ POWERLOGGER_SERVICE(){
QRY="USE servermonitor; INSERT INTO power_data (\`sensorid\`, \`date\`, \`volt\`, \`amp\`) VALUES ('4','${datetime}','${battV}','${battA}')"
${mysql_conn} -e "${QRY}"
sleep 1m
sleep function 1m {
gfds
}d
done
}
UPDATE_SERVICES(){
for srvc in "${partitions3[@]}"; do
/bin/systemctl
}
STOP_SERVICE(){
service_pid=`systemctl show --property MainPID --value ${POWERWALL_SERVICES[${1}]}`
/usr/bin/pkill -P $service_pid
}
SHUTDOWN_SERVERS(){
touch $FOLDER/shutdown
@@ -240,33 +253,21 @@ if [ ${action-x} ]; then
checktemp) CHECKTEMP ${2};;
checktemp_service)
if [ "${2}" = "stop" ]; then
service_pid=`systemctl show --property MainPID --value ${SERVICE_NAME[${3}]}`
/usr/bin/pkill -P $service_pid
#/bin/systemctl stop $srvcname
#/usr/bin/killall bash
STOP_SERVICE ${3}
else
CHECKTEMP_SERVICE ${2}
fi
;;
checkacv_service)
if [ "${2}" = "stop" ]; then
service_pid=`systemctl show --property MainPID --value ${SERVICE_NAME['ACV']}`
/usr/bin/pkill -P $service_pid
#/bin/systemctl stop $srvcname
#/usr/bin/killall bash
STOP_SERVICE ACV
else
CHECKACV_SERVICE
fi
;;
powerlogger_service)
if [ "${2}" = "stop" ]; then
service_pid=`systemctl show --property MainPID --value ${SERVICE_NAME['powerlogger']}`
/usr/bin/pkill -P $service_pid
#/bin/systemctl stop $srvcname
#/usr/bin/killall bash
STOP_SERVICE powerloger
else
POWERLOGGER_SERVICE
fi