initial import
This commit is contained in:
24
wireguard-tools/wg-quick.initd
Normal file
24
wireguard-tools/wg-quick.initd
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
name="WireGuard"
|
||||
description="WireGuard via wg-quick(8)"
|
||||
|
||||
command="${WG_BINARY:-/usr/bin/wg-quick}"
|
||||
CONF="${WG_CONF:-/etc/wireguard/wg0.conf}"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
use dns
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting $description for $CONF"
|
||||
start-stop-daemon --background "${command}" up "$CONF"
|
||||
eend $? "Failed to start $description for $CONF"
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping $description for $CONF"
|
||||
start-stop-daemon --background "${command}" down "$CONF"
|
||||
eend $? "Failed to stop $description for $CONF"
|
||||
}
|
||||
Reference in New Issue
Block a user