Update powerwall.sh

This commit is contained in:
2023-12-13 19:38:36 -06:00
parent 0d7eab64af
commit 77db487ea8

View File

@@ -1157,8 +1157,7 @@ RESTARTALL_SERVICES(){
echo echo
STOPALL_SERVICES STOPALL_SERVICES
echo -en "${idsCL[Yellow]}Pausing${idsCL[Default]}" echo -en "${idsCL[Yellow]}Pausing${idsCL[Default]}"
sleep 2s sleep 6s
# sleep 10s
echo -en "\033[2K\r" echo -en "\033[2K\r"
DIVIDER . yellow 50 DIVIDER . yellow 50
STARTALL_SERVICES STARTALL_SERVICES
@@ -1190,7 +1189,7 @@ SERVICE_MNG(){
MSG="${sa} Service - ${idsCL[LightCyan]}${PW_POWERWALL_SERVICES[${1}]}" MSG="${sa} Service - ${idsCL[LightCyan]}${PW_POWERWALL_SERVICES[${1}]}"
c=0; spc=''; spc1=`expr 53 - ${#MSG}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done c=0; spc=''; spc1=`expr 53 - ${#MSG}`; until [ ${c} = ${spc1} ]; do spc="${spc} "; c=`expr ${c} + 1`; done
echo -en "${idsCL[LightCyan]}${MSG}${spc}${idsCL[Default]}: " echo -en "${idsCL[LightCyan]}${MSG}${spc}${idsCL[Default]}: "
# /bin/systemctl ${2} ${PW_POWERWALL_SERVICES[${1}]} /bin/systemctl ${2} ${PW_POWERWALL_SERVICES[${1}]}
echo -e "${idsCL[Green]}Done${idsCL[Default]}" echo -e "${idsCL[Green]}Done${idsCL[Default]}"
} }
@@ -2381,9 +2380,8 @@ fi
get-snapshots) GET_SNAPSHOTS;; get-snapshots) GET_SNAPSHOTS;;
service) service)
if [ "${2}" == "status" ]; then if [ "${2}" == "status" ] || [ "${3}" == "status" ]; then
CHECK_SERVICES CHECK_SERVICES
elif [ "${2}" == "all" ]; then elif [ "${2}" == "all" ]; then
if [ "${3}" == "stop" ]; then if [ "${3}" == "stop" ]; then
STOPALL_SERVICES STOPALL_SERVICES
@@ -2391,8 +2389,8 @@ fi
STARTALL_SERVICES STARTALL_SERVICES
elif [ "${3}" == "restart" ]; then elif [ "${3}" == "restart" ]; then
RESTARTALL_SERVICES RESTARTALL_SERVICES
elif [ "${3}" == "status" ]; then else
CHECK_SERVICES echo -e "\n${idsCL[Yellow]}Invalid argument${idsCL[Default]}\n"
fi fi
else else
if [ "${3}" == "start" ] || [ "${3}" == "" ]; then if [ "${3}" == "start" ] || [ "${3}" == "" ]; then
@@ -2404,6 +2402,8 @@ fi
CHECKPOWER_SERVICE CHECKPOWER_SERVICE
elif [ "${2}" == "powerlogger" ]; then elif [ "${2}" == "powerlogger" ]; then
POWERLOGGER_SERVICE POWERLOGGER_SERVICE
else
echo -e "\n${idsCL[Yellow]}Invalid argument${idsCL[Default]}\n"
fi fi
elif [ "${3}" == "stop" ]; then elif [ "${3}" == "stop" ]; then
@@ -2425,7 +2425,10 @@ fi
elif [ "${3}" == "restart" ]; then elif [ "${3}" == "restart" ]; then
SERVICE_MNG ${2} stop SERVICE_MNG ${2} stop
sleep 2s echo -en "${idsCL[Yellow]}Pausing${idsCL[Default]}"
sleep 6s
echo -en "\033[2K\r"
DIVIDER . yellow 50
SERVICE_MNG ${2} start SERVICE_MNG ${2} start
elif [ "${3}" == "status" ]; then elif [ "${3}" == "status" ]; then