Skip to content

Commit 964c74d

Browse files
committed
feat(ns-ha): add acme
1 parent 8699a17 commit 964c74d

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

packages/ns-ha/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ define Package/ns-ha/install
5656
$(INSTALL_DATA) ./files/600-qosify $(1)/etc/hotplug.d/keepalived
5757
$(INSTALL_DATA) ./files/600-snort $(1)/etc/hotplug.d/keepalived
5858
$(INSTALL_DATA) ./files/600-ipsec $(1)/etc/hotplug.d/keepalived
59+
$(INSTALL_DATA) ./files/600-acme $(1)/etc/hotplug.d/keepalived
5960
$(INSTALL_DATA) ./files/700-nginx $(1)/etc/hotplug.d/keepalived
6061
$(INSTALL_DATA) ./files/800-adblock $(1)/etc/hotplug.d/keepalived
6162
$(INSTALL_DATA) ./files/800-banip $(1)/etc/hotplug.d/keepalived

packages/ns-ha/files/600-acme

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
3+
. /lib/functions/keepalived/hotplug.sh
4+
. /lib/functions/keepalived/ns.sh
5+
6+
set_service_name acme
7+
8+
set_restart_if_master
9+
set_stop_if_backup
10+
11+
add_sync_file /etc/config/acme
12+
13+
if [ "$ACTION" == "NOTIFY_SYNC" ]; then
14+
home=$(get_rsync_user_home)
15+
rsync -avr $home/etc/acme/ /etc/acme/
16+
elif [ "$ACTION" == "NOTIFY_BACKUP" ]; then
17+
update_cron "disable" "acme"
18+
elif [ "$ACTION" == "NOTIFY_MASTER" ]; then
19+
update_cron "enable" "acme"
20+
fi
21+
22+
keepalived_hotplug

0 commit comments

Comments
 (0)