You are not logged in.
I know, I know, I'm sorry, I am unsure if this the right place to ask this question on but
Really! I couldn't find much help anywhere. I'm on Devuan OpenRC, using the wgcf (wireguard cloudflare) config.
Is there some way to get the config to load every time I boot up (something similar to the command below):
wg-quick up wgcf-profile
It would really help a lot. Thanks lads, I appreciate any help given.
Last edited by DavidRLTG (2024-01-20 19:50:22)
Both depressed, And obsessed with tech!
That's me
-DavidRLTG
Offline
Does openrc use sysvinit scripts? I am not too familiar with openrc/runit/s6, yet, so if I am totally incorrect, please forgive me.
I used this info to create a sysvinit start script using my own wireguard profile config. I hope it helps.
Offline
Hey! I don't think the script works on OpenRC
Besides, sorry for being a newbie, But I'm unsure where to put it or how to
add my own config onto it. Any tips?
Both depressed, And obsessed with tech!
That's me
-DavidRLTG
Offline
please see this post... for a conversion script.
https://dev1galaxy.org/viewtopic.php?id=4865
beware of the start and stop levels after converting to suit your situation.
I haven't tested on wireguard... but I have had success with others.
all the best.
pic from 1993, new guitar day.
Online
Offline
openrc is nothing but some sort of overhead on sysvinit. Give those scripts a try, I guess they will work alright.
Offline
No idea how to add my config to the script. I know, I'm dumb, i just don't see where.
Would you guys be willing to help a complete newbie? 😂
I gotta somehow add wg-quick up wgcf-profile to it. Which lines should I edlt? And where?
No idea how to get stuff like this working, I used to use warp-cli.
Last edited by DavidRLTG (2024-01-22 22:19:44)
Both depressed, And obsessed with tech!
That's me
-DavidRLTG
Offline
From the link above,
Save the above sysvinit script as /etc/init.d/wg0
or "<your-name>" for the script. Make it executable.
Change this line in the script, or keep it as is:
interface=wg0
- or -
interface=<your-name>
Follow the instructions on adding the symlinks. Then try to use the usual service commands to start/stop/status:
service <your-name> start/stop/status
Put your wireguard profile file in /etc/wireguard . Give it your preferred name, maybe "wg0" or <your-name>. The name you give it should be the same through the sysvinit script, and the profile name, I think.
Offline
my /etc/init.d/wg0
cat wg0
#!/bin/sh -eu
# checkconfig: 2345 30 70
# description: set up a WireGuard interface simply
### BEGIN INIT INFO
# Provides: wg-quick
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: set up a WireGuard interface simply
### END INIT INFO
command=/usr/bin/wg-quick
interface=wg0
description="wg-quick on $interface"
logfile=/var/log/$interface.log
status() {
/usr/bin/wg show $interface
}
start() {
touch $logfile && date >>$logfile
echo "starting $description ..." | tee -a $logfile
$command up $interface >>$logfile 2>&1
echo "... started $description" | tee -a $logfile
}
stop() {
touch $logfile && date >>$logfile
echo "stopping $description ..." | tee -a $logfile
$command down $interface >>$logfile 2>&1
echo "... stopped $description" | tee -a $logfile
}
case "${1-}" in
status) status ;;
start) start ;;
restart) stop || true; start ;;
stop) stop ;;
*) echo "usage: $0 {status|start|restart|stop}" ;;
esac
copied with small changes from
https://www.procustodibus.com/blog/2021 … it-script/
Once done run
update-rc.d /etc/init.d/wg0 defaults
server listens at ipv4 and ipv6 :51820
At the moment pinging is possible.
Once this solution has survived some testing, I will add a logrotate file.
If someone has the friendliness to file a bug against the package with this solution, or to complete the missing init-script package ?
(I have problems with reportbug.)
Last edited by bai4Iej2need (2024-06-14 17:01:57)
The devil, you know, is better than the angel, you don't know. by a British Citizen, I don't know too good.
One generation abandons the enterprises of another like stranded vessels. By Henry David Thoreau, WALDEN, Economy. Line 236 (Gutenberg text Version)
broken by design :
https://bugs.debian.org/cgi-bin/bugrepo … bug=958390
Offline