mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-28 12:36:27 +02:00
#707 improve autostart of apcupsd
This commit is contained in:
@@ -327,5 +327,5 @@ if [ ${#undervoltageReports} -gt 0 ] && [ "${undervoltageReports}" != "0" ]; the
|
|||||||
elif [ ${#powerFAIL} -gt 0 ] && [ ${powerFAIL} -gt 0 ]; then
|
elif [ ${#powerFAIL} -gt 0 ] && [ ${powerFAIL} -gt 0 ]; then
|
||||||
echo "Weak power supply detected - run 'Hardware Test' in menu"
|
echo "Weak power supply detected - run 'Hardware Test' in menu"
|
||||||
elif [ ${#ups} -gt 1 ] && [ "${upsStatus}" = "n/a" ]; then
|
elif [ ${#ups} -gt 1 ] && [ "${upsStatus}" = "n/a" ]; then
|
||||||
echo "Power-Emergency Shutdown may happend - reinstall UPS service"
|
echo "UPS service activated but not running"
|
||||||
fi
|
fi
|
@@ -36,6 +36,12 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
|||||||
|
|
||||||
# edit config: /etc/apcupsd/apcupsd.conf
|
# edit config: /etc/apcupsd/apcupsd.conf
|
||||||
sudo systemctl stop apcupsd
|
sudo systemctl stop apcupsd
|
||||||
|
sudo systemctl disable apcupsd
|
||||||
|
|
||||||
|
# make service autostart
|
||||||
|
sudo sed -i '3iAfter=background.service' /lib/systemd/system/apcupsd.service
|
||||||
|
sudo sed -i '3iWants=background.service' /lib/systemd/system/apcupsd.service
|
||||||
|
|
||||||
sudo sed -i "s/^UPSCABLE.*/UPSCABLE usb/g" /etc/apcupsd/apcupsd.conf
|
sudo sed -i "s/^UPSCABLE.*/UPSCABLE usb/g" /etc/apcupsd/apcupsd.conf
|
||||||
sudo sed -i "s/^UPSTYPE.*/UPSTYPE usb/g" /etc/apcupsd/apcupsd.conf
|
sudo sed -i "s/^UPSTYPE.*/UPSTYPE usb/g" /etc/apcupsd/apcupsd.conf
|
||||||
sudo sed -i "s/^DEVICE.*/DEVICE/g" /etc/apcupsd/apcupsd.conf
|
sudo sed -i "s/^DEVICE.*/DEVICE/g" /etc/apcupsd/apcupsd.conf
|
||||||
@@ -46,6 +52,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
|||||||
sudo sed -i "s/^ISCONFIGURED=.*/ISCONFIGURED=yes/g" /etc/default/apcupsd
|
sudo sed -i "s/^ISCONFIGURED=.*/ISCONFIGURED=yes/g" /etc/default/apcupsd
|
||||||
sudo sed -i "s/^SHUTDOWN=.*/SHUTDOWN=\/home\/admin\/XXshutdown.sh/g" /etc/apcupsd/apccontrol
|
sudo sed -i "s/^SHUTDOWN=.*/SHUTDOWN=\/home\/admin\/XXshutdown.sh/g" /etc/apcupsd/apccontrol
|
||||||
sudo sed -i "s/^WALL=.*/#WALL=wall/g" /etc/apcupsd/apccontrol
|
sudo sed -i "s/^WALL=.*/#WALL=wall/g" /etc/apcupsd/apccontrol
|
||||||
|
sudo systemctl enable apcupsd
|
||||||
sudo systemctl start apcupsd
|
sudo systemctl start apcupsd
|
||||||
|
|
||||||
# add default 'ups' raspiblitz.conf if needed
|
# add default 'ups' raspiblitz.conf if needed
|
||||||
|
Reference in New Issue
Block a user