- Go to /etc/init.d directory
- Create file with name "wireguard" and content below.
- Make file executable
chmod +x wireguard - Add to rc-update:
rc-update add wireguard default - That's it
Last active
January 31, 2024 09:49
-
-
Save pr0way/48e18c9584d4b5ecb96f593dec9a938c to your computer and use it in GitHub Desktop.
Simple init script to up & down wireguard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/sbin/openrc-run | |
| depend() { | |
| need localmount | |
| need net | |
| } | |
| start() { | |
| ebegin "Starting wireguard" | |
| /usr/bin/wg-quick up wg0 | |
| eend $? | |
| } | |
| stop() { | |
| ebegin "Stopping wireguard" | |
| /usr/bin/wg-quick down wg0 | |
| eend $? | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Second part is already invalid, it doesn't work without it or with it, but I'll try seeing logs! Thanks for the help