Commit 5bba0735 authored by Nico Schottelius's avatar Nico Schottelius

[wireguard] add init script

parent b6d66309
Pipeline #25754 failed with stages
in 1 minute and 29 seconds
......@@ -37,6 +37,9 @@ package() {
find "$builddir"/contrib -name '.gitignore' -delete
cp -rf "$builddir"/contrib "$pkgdir/usr/share/doc/$pkgname/"
install -D -m755 "$srcdir"/wireguard.initd "$pkgdir"/etc/init.d/wireguard
}
_split() {
......
#!/sbin/openrc-run
# Nico Schottelius, 2020-07-02
# Start all wireguard tunnels with wg-quick
do_wireguard() {
action=$1
[ -d /etc/wireguard ] || exit 0
cd /etc/wireguard
for conf in *.conf; do
name=${conf%%.conf}
[ ${name} = '*' ] && exit 0
ebegin "wireguard ${action} ${name}"
wg-quick ${action} "$name"
done
}
start() {
do_wireguard up
}
stop() {
do_wireguard down
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment