Update powerwall.sh
This commit is contained in:
11
powerwall.sh
11
powerwall.sh
@@ -115,8 +115,11 @@ CHECKACV_SERVICE(){
|
|||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
INPUTACV=$(curl -s "http://10.10.0.61/stats.json" | jq '.inputs .inV')
|
INPUTACV=$(curl -s "http://10.10.0.61/stats.json" | jq '.inputs .inV')
|
||||||
|
datetime="${temp_d} ${temp_t}"
|
||||||
|
datetime=$(TZ=UTC0 date -d "${datetime}" +%s)
|
||||||
|
datetime=`date -d @${datetime} +'%Y-%m-%d %H:%M:%S'`
|
||||||
if [ ${INPUTACV%.*} -gt 105 ]; then
|
if [ ${INPUTACV%.*} -gt 105 ]; then
|
||||||
|
echo "($datetime) normal voltage: ${INPUTACV}V"
|
||||||
fi
|
fi
|
||||||
sleep 30
|
sleep 30
|
||||||
done # &
|
done # &
|
||||||
@@ -193,7 +196,7 @@ if [ ${action-x} ]; then
|
|||||||
if [ "${2}" = "stop" ]; then
|
if [ "${2}" = "stop" ]; then
|
||||||
service_pid=`systemctl show --property MainPID --value ${SERVICE_NAME[${3}]}`
|
service_pid=`systemctl show --property MainPID --value ${SERVICE_NAME[${3}]}`
|
||||||
/bin/kill -9 $service_pid
|
/bin/kill -9 $service_pid
|
||||||
/bin/systemctl stop $srvcname
|
#/bin/systemctl stop $srvcname
|
||||||
#/usr/bin/killall bash
|
#/usr/bin/killall bash
|
||||||
|
|
||||||
else
|
else
|
||||||
@@ -204,11 +207,11 @@ if [ ${action-x} ]; then
|
|||||||
if [ "${2}" = "stop" ]; then
|
if [ "${2}" = "stop" ]; then
|
||||||
service_pid=`systemctl show --property MainPID --value ${SERVICE_NAME[${3}]}`
|
service_pid=`systemctl show --property MainPID --value ${SERVICE_NAME[${3}]}`
|
||||||
/bin/kill -9 $service_pid
|
/bin/kill -9 $service_pid
|
||||||
/bin/systemctl stop $srvcname
|
#/bin/systemctl stop $srvcname
|
||||||
#/usr/bin/killall bash
|
#/usr/bin/killall bash
|
||||||
|
|
||||||
else
|
else
|
||||||
CHECKACV_SERVICE ${2}
|
CHECKACV_SERVICE
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user