[viirb2] allow to inject private key
This commit is contained in:
parent
0875392098
commit
dbe77a6792
1 changed files with 7 additions and 2 deletions
|
@ -3,9 +3,10 @@
|
|||
# See https://ungleich.ch/u/products/viirb-ipv6-box/
|
||||
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "$0 viirb-ip-address viirb-id"
|
||||
echo "$0 viirb-ip-address viirb-id [wgprivkey]"
|
||||
echo " viirb-ip-address: where to find the viirb"
|
||||
echo " viirb-id: number in decimal format"
|
||||
echo " wgprivkey: if specified, use this private key"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -25,7 +26,11 @@ my_lan_ip=${my_prefix}:cafe::42
|
|||
my_wifi_ip=${my_prefix}:7ea::42
|
||||
|
||||
# wireguard
|
||||
private_key=$(wg genkey)
|
||||
if [ $# -eq 1 ]; then
|
||||
private_key=$1; shift
|
||||
else
|
||||
private_key=$(wg genkey)
|
||||
fi
|
||||
public_key=$(echo $private_key | wg pubkey)
|
||||
|
||||
vpn_endpoint_host=vpn-2a0ae5c1300.ungleich.ch
|
||||
|
|
Loading…
Reference in a new issue