• R/O
  • HTTP
  • SSH
  • HTTPS

packages: Commit

Community maintained packages for ImmortalWrt.


Commit MetaInfo

Révision317ba6a43ee06edd694ed51d14508a482fbbceb1 (tree)
l'heure2022-01-20 21:57:46
AuteurNick Hainke <vincent@syst...>
CommiterNick Hainke

Message de Log

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)

Change Summary

Modification

--- a/net/wg-installer/Makefile
+++ b/net/wg-installer/Makefile
@@ -39,6 +39,9 @@ define Package/wg-installer-server/install
3939
4040 $(INSTALL_DIR) $(1)/etc/config
4141 $(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
4245 endef
4346
4447 define Package/wg-installer-server/postinst
--- /dev/null
+++ b/net/wg-installer/wg-server/config/wgserver.init
@@ -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+}
Afficher sur ancien navigateur de dépôt.