Community maintained packages for ImmortalWrt.
Révision | 317ba6a43ee06edd694ed51d14508a482fbbceb1 (tree) |
---|---|
l'heure | 2022-01-20 21:57:46 |
Auteur | Nick Hainke <vincent@syst...> |
Commiter | Nick Hainke |
wg-installer: install cronjob
Install a cronjob that removes unused wireguard interfaces every 10
minutes.
Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 432a965689f09c6bb86cd24753f79d739b9bcf46)
@@ -39,6 +39,9 @@ define Package/wg-installer-server/install | ||
39 | 39 | |
40 | 40 | $(INSTALL_DIR) $(1)/etc/config |
41 | 41 | $(INSTALL_CONF) ./wg-server/config/wgserver.conf $(1)/etc/config/wgserver |
42 | + | |
43 | + $(INSTALL_DIR) $(1)/etc/init.d | |
44 | + $(INSTALL_BIN) ./wg-server/config/wgserver.init $(1)/etc/init.d/wgserver | |
42 | 45 | endef |
43 | 46 | |
44 | 47 | define Package/wg-installer-server/postinst |
@@ -0,0 +1,12 @@ | ||
1 | +#!/bin/sh /etc/rc.common | |
2 | + | |
3 | +START=99 | |
4 | + | |
5 | +# install cleanup script that executes every 10 min | |
6 | +boot() { | |
7 | + test -f /etc/crontabs/root || touch /etc/crontabs/root | |
8 | + grep -q '/usr/share/wginstaller/wg.sh cleanup_wginterfaces' /etc/crontabs/root || { | |
9 | + echo "*/10 * * * * /usr/share/wginstaller/wg.sh cleanup_wginterfaces" >> /etc/crontabs/root | |
10 | + } | |
11 | + /etc/init.d/cron restart | |
12 | +} |