HEX
Server: Apache/2.4.63 (Unix)
System: Linux TOMS-220NAS 4.4.302+ #86009 SMP Wed Nov 26 18:19:17 CST 2025 x86_64
User: flavio87 (1026)
PHP: 8.3.27
Disabled: NONE
Upload Files
File: //usr/syno/lib/systemd/scripts/ups-plugout-notify.sh
#!/bin/sh

SYNOUPS_CONF="/usr/syno/etc/ups/synoups.conf"
UPS_NOTIFY="/lib/udev/script/synoupsnotify.sh"
SERVICE_RUNNING=`/usr/syno/bin/synogetkeyvalue $SYNOUPS_CONF ups_enabled`

PLUGIN_STATUS=`/usr/syno/bin/synosystemctl get-active-status ups-plugin-notify.service`
RESET_USB_STATUS=`/usr/syno/bin/synosystemctl get-active-status ups-reset-usb.service`

case "$1" in
start)
	if [ "active" != "$RESET_USB_STATUS" ]; then
		/usr/syno/bin/synologset1 sys warn 0x11300018
		if [ "$SERVICE_RUNNING" == "yes" ]; then
			$UPS_NOTIFY UPSDisconnect
		fi
		/usr/syno/bin/synosystemctl stop ups-plugin-notify.service
	fi
	;;
stop)
	;;
restart)
	;;
esac