diff --git a/vpnsetup.sh b/vpnsetup.sh index 4265158..7cfcffa 100755 --- a/vpnsetup.sh +++ b/vpnsetup.sh @@ -71,17 +71,15 @@ NET_IF0=${VPN_IFACE:-'eth0'} NET_IFS=${VPN_IFACE:-'eth+'} if_state=$(cat "/sys/class/net/$NET_IF0/operstate" 2>/dev/null) if [ -z "$if_state" ] || [ "$if_state" = "down" ] || [ "$NET_IF0" = "lo" ]; then - echo "Error: Network interface '$NET_IF0' is not available." >&2 + printf "Error: Network interface '%s' is not available.\n" "$NET_IF0" >&2 + printf '\n%s\n' "DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC!" >&2 + printf '\n%s\n\n' "If running on a server, try this workaround:" >&2 cat 1>&2 <<'EOF' - -DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! - -If running on a server, try this workaround: - VPN_IFACE="$(route | grep '^default' | grep -o '[^ ]*$')" EOF cat 1>&2 </dev/null) if [ -z "$if_state" ] || [ "$if_state" = "down" ] || [ "$NET_IF0" = "lo" ]; then - echo "Error: Network interface '$NET_IF0' is not available." >&2 + printf "Error: Network interface '%s' is not available.\n" "$NET_IF0" >&2 + printf '\n%s\n' "DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC!" >&2 + printf '\n%s\n\n' "If running on a server, try this workaround:" >&2 cat 1>&2 <<'EOF' - -DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! - -If running on a server, try this workaround: - VPN_IFACE="$(route | grep '^default' | grep -o '[^ ]*$')" EOF cat 1>&2 <