mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
fix: check if file exists
This commit is contained in:
parent
f315f05073
commit
4213d169bf
@ -425,7 +425,10 @@ function _download_latest_files() {
|
|||||||
if [ "$upgrade" == 1 ]; then
|
if [ "$upgrade" == 1 ]; then
|
||||||
_install_log "Applying existing configuration to ${webroot_dir}/includes"
|
_install_log "Applying existing configuration to ${webroot_dir}/includes"
|
||||||
sudo mv /tmp/config.php $webroot_dir/includes || _install_status 1 "Unable to move config.php to ${webroot_dir}/includes"
|
sudo mv /tmp/config.php $webroot_dir/includes || _install_status 1 "Unable to move config.php to ${webroot_dir}/includes"
|
||||||
sudo mv /tmp/raspap.auth $raspap_dir || _install_status 1 "Unable to restore authentification credentials file to ${raspap_dir}"
|
|
||||||
|
if [ -f /tmp/raspap.auth ]; then
|
||||||
|
sudo mv /tmp/raspap.auth $raspap_dir || _install_status 1 "Unable to restore authentification credentials file to ${raspap_dir}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_install_status 0
|
_install_status 0
|
||||||
@ -446,7 +449,10 @@ function _check_for_old_configs() {
|
|||||||
if [ "$upgrade" == 1 ]; then
|
if [ "$upgrade" == 1 ]; then
|
||||||
_install_log "Moving existing configuration to /tmp"
|
_install_log "Moving existing configuration to /tmp"
|
||||||
sudo mv $webroot_dir/includes/config.php /tmp || _install_status 1 "Unable to move config.php to /tmp"
|
sudo mv $webroot_dir/includes/config.php /tmp || _install_status 1 "Unable to move config.php to /tmp"
|
||||||
sudo mv $raspap_dir/raspap.auth /tmp || _install_status 1 "Unable to backup raspap.auth to /tmp"
|
|
||||||
|
if [ -f $raspap_dir/raspap.auth ]; then
|
||||||
|
sudo mv $raspap_dir/raspap.auth /tmp || _install_status 1 "Unable to backup raspap.auth to /tmp"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
_install_log "Backing up existing configs to ${raspap_dir}/backups"
|
_install_log "Backing up existing configs to ${raspap_dir}/backups"
|
||||||
if [ -f /etc/network/interfaces ]; then
|
if [ -f /etc/network/interfaces ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user