diff options
author | nachoparker <nacho@ownyourbits.com> | 2018-02-08 16:10:30 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2018-02-08 16:10:30 +0300 |
commit | fc0d3f96f246fe179b626c143c138a17b08fcf8b (patch) | |
tree | fe6752b4d4504600e33673d9ab71b0260df07fad /bin | |
parent | ab865519e232810307f93f65bac1894be1cf1e1d (diff) |
do not rely on pings, just return value of operationsv0.46.4
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ncp-check-version | 7 | ||||
-rwxr-xr-x | bin/ncp-update | 6 |
2 files changed, 8 insertions, 5 deletions
diff --git a/bin/ncp-check-version b/bin/ncp-check-version index 23335aaf..35b91181 100755 --- a/bin/ncp-check-version +++ b/bin/ncp-check-version @@ -4,11 +4,12 @@ [ $(id -u) -ne 0 ] && exit 1 -ping -W 2 -w 1 -q 4.2.2.2 &>/dev/null || { echo "No internet connectivity"; exit 1; } - rm -rf /tmp/ncp-check-tmp -git clone --depth 20 -q --bare https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-check-tmp || exit 1 +git clone --depth 20 -q --bare https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-check-tmp { + echo "No internet connectivity" + exit 1 +} cd /tmp/ncp-check-tmp || exit 1 VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" ) diff --git a/bin/ncp-update b/bin/ncp-update index 1195ab4e..53cadc45 100755 --- a/bin/ncp-update +++ b/bin/ncp-update @@ -4,10 +4,12 @@ { [ "$(id -u)" -ne 0 ] && { printf "Must be run as root. Try 'sudo $0'\n"; exit 1; } - ping -W 2 -w 1 -q 4.2.2.2 &>/dev/null || { echo "No internet connectivity"; exit 1; } echo -e "Downloading updates" rm -rf /tmp/ncp-update-tmp - git clone --depth 20 -q https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-update-tmp || exit 1 + git clone --depth 20 -q https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-update-tmp || { + echo "No internet connectivity" + exit 1 + } cd /tmp/ncp-update-tmp echo -e "Performing updates" |