diff options
author | Stanislas Lange <stanislas.lange@pm.me> | 2020-08-03 16:26:29 +0200 |
---|---|---|
committer | Stanislas Lange <stanislas.lange@pm.me> | 2020-08-03 16:26:29 +0200 |
commit | 4138ada539c7f9fbcd4fd97b769fe7c627330b18 (patch) | |
tree | 4386147bd7221afef911dc95132a3e6baacef48a | |
parent | 1923aa17e6b27d94876411ea73ebb65647324547 (diff) |
Format with shfmt
-rw-r--r-- | wireguard-install.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/wireguard-install.sh b/wireguard-install.sh index 1eb4263..fda5711 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -221,7 +221,7 @@ function newClient() { echo "Tell me a name for the client." echo "Use one word only, no special characters." - until [[ "${CLIENT_NAME}" =~ ^[a-zA-Z0-9_]+$ && "${CLIENT_EXISTS}" == '0' ]]; do + until [[ ${CLIENT_NAME} =~ ^[a-zA-Z0-9_]+$ && ${CLIENT_EXISTS} == '0' ]]; do read -rp "Client name: " -e CLIENT_NAME CLIENT_EXISTS=$(grep -c -E "^### Client ${CLIENT_NAME}\$" "/etc/wireguard/${SERVER_WG_NIC}.conf") @@ -245,7 +245,7 @@ function newClient() { exit 1 fi - until [[ "${IPV4_EXISTS}" == '0' ]]; do + until [[ ${IPV4_EXISTS} == '0' ]]; do read -rp "Client's WireGuard IPv4: ${SERVER_WG_IPV4::-1}" -e -i "${DOT_IP}" DOT_IP CLIENT_WG_IPV4="${SERVER_WG_IPV4::-1}${DOT_IP}" IPV4_EXISTS=$(grep -c "$CLIENT_WG_IPV4" "/etc/wireguard/${SERVER_WG_NIC}.conf") @@ -257,7 +257,7 @@ function newClient() { fi done - until [[ "${IPV6_EXISTS}" == '0' ]]; do + until [[ ${IPV6_EXISTS} == '0' ]]; do read -rp "Client's WireGuard IPv6: ${SERVER_WG_IPV6::-1}" -e -i "${DOT_IP}" DOT_IP CLIENT_WG_IPV6="${SERVER_WG_IPV6::-1}${DOT_IP}" IPV6_EXISTS=$(grep -c "${CLIENT_WG_IPV6}" "/etc/wireguard/${SERVER_WG_NIC}.conf") |