Skip to content

Commit

Permalink
noip: make possible to reconfigure while running
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Oct 25, 2017
1 parent 4c7e562 commit 8f54ff7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions etc/nextcloudpi-config.d/no-ip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,19 @@ EOF

configure()
{
[[ $ACTIVE_ != "yes" ]] && { service noip2 stop; update-rc.d noip2 disable; return 0; }
service noip2 stop
[[ $ACTIVE_ != "yes" ]] && { update-rc.d noip2 disable; return 0; }

ping -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; return 1; }
ping -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; return 1; echo "noip DDNS disabled"; }

/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
service noip2 restart
cd /var/www/nextcloud
sudo -u www-data php occ config:system:set trusted_domains 3 --value="$DOMAIN_"
sudo -u www-data php occ config:system:set overwrite.cli.url --value=https://"$DOMAIN_"
echo "noip DDNS enabled"

}

# License
Expand Down

0 comments on commit 8f54ff7

Please sign in to comment.