diff options
author | nachoparker <nacho@ownyourbits.com> | 2017-08-31 07:12:22 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2017-08-31 07:12:33 +0300 |
commit | a86efea78ebc241ce51db3cd4d747a744558e51e (patch) | |
tree | aa9568b341940df475a807d4a2fe4ad2cf2d4a87 /etc/nextcloudpi-config.d | |
parent | 2c911be3611d5011c4f8e0d09c21706e259a6a45 (diff) |
various extras: check internet connectivityv0.24.10
Diffstat (limited to 'etc/nextcloudpi-config.d')
-rw-r--r-- | etc/nextcloudpi-config.d/letsencrypt.sh | 2 | ||||
-rw-r--r-- | etc/nextcloudpi-config.d/nc-nextcloud.sh | 1 | ||||
-rw-r--r-- | etc/nextcloudpi-config.d/no-ip.sh | 4 |
3 files changed, 6 insertions, 1 deletions
diff --git a/etc/nextcloudpi-config.d/letsencrypt.sh b/etc/nextcloudpi-config.d/letsencrypt.sh index 980d34f9..8ca0f82c 100644 --- a/etc/nextcloudpi-config.d/letsencrypt.sh +++ b/etc/nextcloudpi-config.d/letsencrypt.sh @@ -44,6 +44,8 @@ Your certificate will be automatically renewed every month # tested with git version v0.11.0-71-g018a304 configure() { + ping -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; return 1; } + grep -q ServerName $VHOSTCFG && \ sed -i "s|ServerName .*|ServerName $DOMAIN_|" $VHOSTCFG || \ sed -i "/DocumentRoot/aServerName $DOMAIN_" $VHOSTCFG diff --git a/etc/nextcloudpi-config.d/nc-nextcloud.sh b/etc/nextcloudpi-config.d/nc-nextcloud.sh index 57681b19..84013b5f 100644 --- a/etc/nextcloudpi-config.d/nc-nextcloud.sh +++ b/etc/nextcloudpi-config.d/nc-nextcloud.sh @@ -44,6 +44,7 @@ install() { :; } configure() { + ping -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; return 1; } ## RE-CREATE DATABASE TABLE echo "Starting mariaDB" diff --git a/etc/nextcloudpi-config.d/no-ip.sh b/etc/nextcloudpi-config.d/no-ip.sh index 08e948f2..118aeeb8 100644 --- a/etc/nextcloudpi-config.d/no-ip.sh +++ b/etc/nextcloudpi-config.d/no-ip.sh @@ -66,7 +66,9 @@ EOF configure() { - [[ $ACTIVE_ != "yes" ]] && { service noip2 stop; update-rc.d noip2 disable; return; } + [[ $ACTIVE_ != "yes" ]] && { service noip2 stop; update-rc.d noip2 disable; return 0; } + + ping -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; return 1; } /usr/local/bin/noip2 -C -c /usr/local/etc/no-ip2.conf -U $TIME_ -u $USER_ -p $PASS_ || return 1 update-rc.d noip2 enable |