2025-05-14 23:06:09 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#if MODE = netserver then access should be private
|
|
|
|
#if MODE = netclient only enable monitor
|
|
|
|
|
|
|
|
# calling this script to configure unit and drivers
|
2025-05-15 23:36:41 -04:00
|
|
|
if [[ $(/sbin/e-smith/config getprop nut status || echo "disabled") == "disabled" ]] ; then
|
2025-05-14 23:06:09 -04:00
|
|
|
# disable server
|
|
|
|
# leave monitor as is, we might want to monitor an external ups ?
|
|
|
|
# get_all_by_prop filter nut-driver@ and foreach $UPS disabled
|
|
|
|
exit 0;
|
|
|
|
fi
|
|
|
|
# nut is enabled
|
|
|
|
# enable nut-monitor
|
|
|
|
# enable nut-server "enable nut-server.service\n" if ($master eq 'yes');
|
|
|
|
# get_all_by_prop filter nut-driver@ and foreach $UPS enable.
|
|
|
|
|
|
|
|
/usr/libexec/nut-driver-enumerator.sh
|