synology-wireguard/scripts/start
2021-02-06 19:51:59 +01:00

19 lines
364 B
Bash
Executable File

#!/bin/sh
if [ "$EUID" -ne 0 ]; then
echo "This script must be run as root"
exit 1
fi
dir=`dirname $0`
sed -i 's/package/root/' "$dir/../conf/privilege"
synopkg start WireGuard > /dev/null
if [ "$?" -eq 0 ]; then
echo "WireGuard has been successfully started"
exit 0
else
echo "An error occurred during WireGuard startup" 1>&2
exit 1
fi