Skip to content

Commit c9aa830

Browse files
committed
remove useless echo
1 parent 4adf8e6 commit c9aa830

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

controlplane.sh

+3-6
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ case "$1" in
1616

1717
sudo mkdir -p /etc/wireguard
1818

19-
if ! sudo test -f "/etc/wireguard/controlplane.conf"; then
20-
sudo test -f "/etc/wireguard/private.key" || wg genkey | sudo tee "/etc/wireguard/private.key" > /dev/null
21-
cat << EOF | sudo tee /etc/wireguard/controlplane.conf
19+
sudo test -f "/etc/wireguard/private.key" || wg genkey | sudo tee "/etc/wireguard/private.key" > /dev/null
20+
cat << EOF | sudo tee /etc/wireguard/controlplane.conf
2221
[Interface]
2322
PrivateKey = $(cat /etc/wireguard/private.key)
2423
@@ -27,8 +26,7 @@ PublicKey = $gw_public
2726
AllowedIPs = $gw_ip
2827
Endpoint = $gw_endpoint
2928
EOF
30-
sudo chmod 600 /etc/wireguard/controlplane.conf
31-
fi
29+
sudo chmod 600 /etc/wireguard/controlplane.conf
3230

3331
sudo wireguard-go "$dev"
3432
sudo wg setconf "$dev" /etc/wireguard/controlplane.conf
@@ -37,7 +35,6 @@ EOF
3735
sudo ifconfig "$dev" up
3836
sudo route -q -n add -inet "$network" -interface "$dev"
3937
sudo wg
40-
echo -e "done! your public key:\n$(sudo cat /etc/wireguard/private.key | wg pubkey)"
4138
;;
4239

4340
"down")

0 commit comments

Comments
 (0)