commit a051cdc5ff5e4560e25a786439ce9167fb95fc05 parent bbb2a6f753d87689ce5f0f0882be2ba52a52596f Author: Alex Balgavy <alex@balgavy.eu> Date: Sun, 2 Jan 2022 11:10:26 +0100 publish: check if vps is reachable Diffstat:
M | scripts/publish | | | 3 | ++- |
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/publish b/scripts/publish @@ -1,7 +1,8 @@ #!/bin/sh -[ -d ./public ] || { echo "No public/ folder present in current directory" && exit 1; } +[ -d ./public ] || { printf "No public/ folder present in current directory\n" && exit 1; } destdir=/var/www/"$(basename "$(pwd)")" +ping -c 1 vps >/dev/null 2>&1 || { printf "Host 'vps' not reachable.\n" && exit 1; } printf "Upload public/ to vps:%s? [Y/n] " "$destdir" read -r conf case "$conf" in