diff --git a/nextcloud-startup-script.sh b/nextcloud-startup-script.sh index d4770579..a5b8cbc5 100644 --- a/nextcloud-startup-script.sh +++ b/nextcloud-startup-script.sh @@ -36,27 +36,11 @@ done is_process_running apt is_process_running dpkg -# Use local lib file in case there is no internet connection -if print_text_in_color "$ICyan" "Testing internet connection..." && ping github.com -c 2 >/dev/null 2>&1 -then -# shellcheck disable=2034,2059 +# shellcheck disable=2034,2059,1091 true -SCRIPT_NAME="Nextcloud First Startup Script" +SCRIPT_NAME="Nextcloud Startup Script" # shellcheck source=lib.sh -. <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh) - # If we have internet, then use the latest variables from the lib remote file -elif [ -f /var/scripts/lib.sh ] -then -# shellcheck disable=2034,2059 -true -SCRIPT_NAME="Nextcloud First Startup Script" -# shellcheck source=lib.sh -source /var/scripts/lib.sh -else - print_text_in_color "$IRed" "You don't seem to have a working internet connection, and /var/scripts/lib.sh is missing so you can't run this script." - print_text_in_color "$IRed" "Please report this to https://github.com/nextcloud/vm/issues/" - exit 1 -fi +source /var/scripts/fetch_lib.sh # Get all needed variables from the library first_iface @@ -135,8 +119,11 @@ Please also post this issue on: https://github.com/nextcloud/vm/issues" exit 1 fi +# shellcheck disable=2034,2059,1091 +true +SCRIPT_NAME="Nextcloud Startup Script" # shellcheck source=lib.sh -. <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh) +source /var/scripts/fetch_lib.sh # Get all needed variables from the library ncdb diff --git a/static/fetch_lib.sh b/static/fetch_lib.sh index 087be213..ccb1babe 100644 --- a/static/fetch_lib.sh +++ b/static/fetch_lib.sh @@ -27,8 +27,11 @@ then exit 1 fi else - print_text_in_color "$ICyan" "Updating lib..." - curl -sfL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh -o /var/scripts/lib.sh + if ! [ -f /var/scripts/nextcloud-startup-script.sh ] + then + print_text_in_color "$ICyan" "Updating lib..." + curl -sfL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh -o /var/scripts/lib.sh + fi fi # shellcheck source=lib.sh