Skip to content

Commit

Permalink
various extras: check internet connectivity
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Aug 31, 2017
1 parent 2c911be commit a86efea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions etc/nextcloudpi-config.d/letsencrypt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions etc/nextcloudpi-config.d/nc-nextcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion etc/nextcloudpi-config.d/no-ip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a86efea

Please sign in to comment.