0
0
mirror of https://github.com/openwrt/packages.git synced 2025-03-15 10:18:37 +00:00
Nick Hainke 432a965689 wg-installer: install cronjob
Install a cronjob that removes unused wireguard interfaces every 10
minutes.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-01-20 09:51:05 +01:00

13 lines
381 B
Bash

#!/bin/sh /etc/rc.common
START=99
# install cleanup script that executes every 10 min
boot() {
test -f /etc/crontabs/root || touch /etc/crontabs/root
grep -q '/usr/share/wginstaller/wg.sh cleanup_wginterfaces' /etc/crontabs/root || {
echo "*/10 * * * * /usr/share/wginstaller/wg.sh cleanup_wginterfaces" >> /etc/crontabs/root
}
/etc/init.d/cron restart
}