fixup! wg: new package
This commit is contained in:
parent
5a026a9a1f
commit
9aaee740f5
1 changed files with 3 additions and 4 deletions
|
@ -9,12 +9,11 @@ cmdline() {
|
||||||
[ "$value" != "" ] && echo "$value"
|
[ "$value" != "" ] && echo "$value"
|
||||||
}
|
}
|
||||||
|
|
||||||
mkdir -p /etc/wireguard/
|
[ -f "/etc/wireguard/adlin.token" ] && WGTOKEN=$(cat /etc/wireguard/adlin.token)
|
||||||
WGTOKEN=$(cmdline adlin.token)
|
[ -z "${WGTOKEN}" ] && WGTOKEN=$(cmdline adlin.token)
|
||||||
[ -z "${WGTOKEN}" ] && [ -f "/etc/wireguard/adlin.token" ] && WGTOKEN=$(cat /etc/wireguard/adlin.token)
|
|
||||||
[ -z "${WGTOKEN}" ] && {
|
[ -z "${WGTOKEN}" ] && {
|
||||||
echo -n "You didn't define your token to connect the network. Please copy it here now: "
|
echo -n "You didn't define your token to connect the network. Please copy it here now: "
|
||||||
read WGTOKEN
|
exit 1
|
||||||
}
|
}
|
||||||
[ -f "/etc/wireguard/adlin.conf" ] && WGPRVKEY=$(sed 's/^.*PrivateKey *= *//p;d' /etc/wireguard/adlin.conf)
|
[ -f "/etc/wireguard/adlin.conf" ] && WGPRVKEY=$(sed 's/^.*PrivateKey *= *//p;d' /etc/wireguard/adlin.conf)
|
||||||
[ -z "${WGPRVKEY}" ] && WGPRVKEY=$(/usr/bin/wg genkey)
|
[ -z "${WGPRVKEY}" ] && WGPRVKEY=$(/usr/bin/wg genkey)
|
||||||
|
|
Reference in a new issue