mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Remove temp $source_dir if exists, sudo rm raspap_install.log
This commit is contained in:
parent
c0bf18bf50
commit
2102fb9043
@ -547,6 +547,10 @@ function _create_openvpn_scripts() {
|
|||||||
function _download_latest_files() {
|
function _download_latest_files() {
|
||||||
_install_log "Cloning latest files from GitHub"
|
_install_log "Cloning latest files from GitHub"
|
||||||
source_dir="/tmp/raspap-webgui"
|
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 [ "$repo" == "RaspAP/raspap-insiders" ]; then
|
||||||
if [ -n "$username" ] && [ -n "$acctoken" ]; then
|
if [ -n "$username" ] && [ -n "$acctoken" ]; then
|
||||||
insiders_source_url="https://${username}:${acctoken}@github.com/$repo"
|
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
|
git clone --branch $branch --depth 1 -c advice.detachedHead=false $git_source_url $source_dir || clone=false
|
||||||
fi
|
fi
|
||||||
if [ "$clone" = false ]; then
|
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
|
echo "The installer cannot continue." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -188,7 +188,7 @@ function _setup_colors() {
|
|||||||
function _log_output() {
|
function _log_output() {
|
||||||
readonly LOGFILE_PATH="/tmp"
|
readonly LOGFILE_PATH="/tmp"
|
||||||
if [ -f "$LOGFILE_PATH/raspap_install.log" ]; then
|
if [ -f "$LOGFILE_PATH/raspap_install.log" ]; then
|
||||||
rm "$LOGFILE_PATH/raspap_install.log"
|
sudo rm "$LOGFILE_PATH/raspap_install.log"
|
||||||
fi
|
fi
|
||||||
exec > >(tee -i $LOGFILE_PATH/raspap_install.log)
|
exec > >(tee -i $LOGFILE_PATH/raspap_install.log)
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user