Browse Source

Merge pull request #8830 from cshoredaniel/pr-nut-nutmon+fsd-fixes

nut: nutmon+fsd fixes
lilik-openwrt-22.03
Rosen Penev 5 years ago
committed by GitHub
parent
commit
0038d6e971
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 10 deletions
  1. +1
    -1
      net/nut/Makefile
  2. +6
    -9
      net/nut/files/nut-monitor.init
  3. +2
    -0
      net/nut/files/nutshutdown

+ 1
- 1
net/nut/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=nut
PKG_VERSION:=2.7.4
PKG_RELEASE:=15
PKG_RELEASE:=16
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.networkupstools.org/source/2.7/


+ 6
- 9
net/nut/files/nut-monitor.init View File

@ -148,7 +148,6 @@ nut_upsmon_add() {
}
build_config() {
local runas=nutmon
mkdir -m 0750 -p "$(dirname "$UPSMON_C")"
config_load nut_monitor
@ -193,6 +192,7 @@ interface_triggers() {
}
start_service() {
local runas=nutmon
local havemon havems
build_config
@ -210,16 +210,9 @@ start_service() {
return 0
}
restart() {
trap '' TERM
stop "$@"
sleep 2
trap - TERM
start "$@"
}
reload_service() {
if pgrep upsmon >/dev/null 2>/dev/null; then
local runas=nutmon
build_config
/usr/sbin/upsmon -c reload
else
@ -227,6 +220,10 @@ reload_service() {
fi
}
stop_service() {
upsmon -c stop
}
service_triggers() {
config_load nut_monitor
interface_triggers "add_trigger"


+ 2
- 0
net/nut/files/nutshutdown View File

@ -47,3 +47,5 @@ do_fsd() {
poweroff
fi
}
do_fsd

Loading…
Cancel
Save