From 80f3892ba0bfa83d40987d66a3518cecaa64f37d Mon Sep 17 00:00:00 2001 From: OJ Randon Date: Tue, 15 Apr 2025 17:39:14 +0200 Subject: [PATCH] check if update script for selfHOST was downloaded --- .debianinstall/debian-setup.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.debianinstall/debian-setup.sh b/.debianinstall/debian-setup.sh index fef13724e..2982b82eb 100644 --- a/.debianinstall/debian-setup.sh +++ b/.debianinstall/debian-setup.sh @@ -308,10 +308,19 @@ function install_run_selfhost { # https://carol.selfhost.de/update?username=123456&password=supersafe # # the prefered way - wget --output-document=$selfhostdir/$selfhostscript https://jonaspasche.de/selfhost-updater - echo "router" > $selfhostdir/device - echo "$selfhost_user" > $selfhostdir/user - echo "$selfhost_pass" > $selfhostdir/pass + if [ ! -f $selfhostdir/$selfhostscript ] + then + wget --output-document=$selfhostdir/$selfhostscript https://jonaspasche.de/selfhost-updater + if [ ! -s $selfhostdir/$selfhostscript ] + then + die "Failed to download selfHOST file for dynDNS" + fi + echo "router" > $selfhostdir/device + echo "$selfhost_user" > $selfhostdir/user + echo "$selfhost_pass" > $selfhostdir/pass + print_info "Wrote file to update dynamic IP. File: $selfhostdir/$selfhostscript" + fi + print_info "executing $selfhostdir/$selfhostscript update..." bash $selfhostdir/$selfhostscript update fi }