net/keepalived: add keepalived.user script handling
Add keepalived.user script handling which are also saved during sysupgrade. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
parent
ff33ff463b
commit
738da3146c
3 changed files with 26 additions and 0 deletions
|
@ -39,6 +39,7 @@ endef
|
||||||
define Package/keepalived/conffiles
|
define Package/keepalived/conffiles
|
||||||
/etc/keepalived/keepalived.conf
|
/etc/keepalived/keepalived.conf
|
||||||
/etc/config/keepalived
|
/etc/config/keepalived
|
||||||
|
/etc/keepalived.user
|
||||||
endef
|
endef
|
||||||
|
|
||||||
CONFIGURE_ARGS+= \
|
CONFIGURE_ARGS+= \
|
||||||
|
@ -62,6 +63,10 @@ define Package/keepalived/install
|
||||||
$(INSTALL_BIN) ./files/keepalived.init $(1)/etc/init.d/keepalived
|
$(INSTALL_BIN) ./files/keepalived.init $(1)/etc/init.d/keepalived
|
||||||
$(INSTALL_DIR) $(1)/etc/config
|
$(INSTALL_DIR) $(1)/etc/config
|
||||||
$(INSTALL_CONF) ./files/keepalived.config $(1)/etc/config/keepalived
|
$(INSTALL_CONF) ./files/keepalived.config $(1)/etc/config/keepalived
|
||||||
|
$(INSTALL_DIR) $(1)/etc
|
||||||
|
$(INSTALL_CONF) ./files/keepalived.user $(1)/etc/keepalived.user
|
||||||
|
$(INSTALL_DIR) $(1)/etc/hotplug.d/keepalived
|
||||||
|
$(INSTALL_DATA) ./files/hotplug-user $(1)/etc/hotplug.d/keepalived/01-user
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,keepalived))
|
$(eval $(call BuildPackage,keepalived))
|
||||||
|
|
7
net/keepalived/files/hotplug-user
Normal file
7
net/keepalived/files/hotplug-user
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
[ -f "/etc/keepalived.user" ] && {
|
||||||
|
/bin/sh /etc/keepalived.user "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
exit 0
|
14
net/keepalived/files/keepalived.user
Normal file
14
net/keepalived/files/keepalived.user
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# This file is interpreted as a shell script.
|
||||||
|
# The first line of the script must be "#!/bin/sh" without quotes.
|
||||||
|
# Lines beginning with # are comments and are not executed.
|
||||||
|
#
|
||||||
|
# There are three environment arguments that are passed to this script.
|
||||||
|
#
|
||||||
|
# $TYPE Set to INSTANCE or GROUP, depending on whether keepalived invoked the program from vrrp_instance or vrrp_sync_group.
|
||||||
|
# $NAME Set to the name of the vrrp_instance or vrrp_sync_group.
|
||||||
|
# $ACTION Set to the end state of the transition.
|
||||||
|
# Valid values are:
|
||||||
|
# $TYPE==INSTANCE: [ NOTIFY_BACKUP | NOTIFY_MASTER | NOTIFY_FAULT | NOTIFY_STOP | NOTIFY ]
|
||||||
|
# $TYPE==GROUP: [ NOTIFY_BACKUP | NOTIFY_MASTER | NOTIFY_FAULT | NOTIFY ]
|
Loading…
Reference in a new issue