diff --git a/installers/common.sh b/installers/common.sh index 02b6d201..d3b98f55 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -547,6 +547,10 @@ function _create_openvpn_scripts() { function _download_latest_files() { _install_log "Cloning latest files from GitHub" source_dir="/tmp/raspap-webgui" + if [ -d "$source_dir" ]; then + echo "Temporary download destination $source_dir exists. Removing..." + rm -r "$source_dir" + fi if [ "$repo" == "RaspAP/raspap-insiders" ]; then if [ -n "$username" ] && [ -n "$acctoken" ]; then insiders_source_url="https://${username}:${acctoken}@github.com/$repo" @@ -560,7 +564,7 @@ function _download_latest_files() { git clone --branch $branch --depth 1 -c advice.detachedHead=false $git_source_url $source_dir || clone=false fi if [ "$clone" = false ]; then - _install_status 1 "Unable to download files from github" + _install_status 1 "Unable to download files from GitHub" echo "The installer cannot continue." >&2 exit 1 fi diff --git a/installers/raspbian.sh b/installers/raspbian.sh index 357c184e..c4a0a4fe 100755 --- a/installers/raspbian.sh +++ b/installers/raspbian.sh @@ -188,7 +188,7 @@ function _setup_colors() { function _log_output() { readonly LOGFILE_PATH="/tmp" if [ -f "$LOGFILE_PATH/raspap_install.log" ]; then - rm "$LOGFILE_PATH/raspap_install.log" + sudo rm "$LOGFILE_PATH/raspap_install.log" fi exec > >(tee -i $LOGFILE_PATH/raspap_install.log) exec 2>&1