Fixed up installation script to allow for reinstalls over existing installs.

This commit is contained in:
Lawrence 2017-10-01 23:22:07 +08:00
parent a36e525f98
commit a6b1d85013
1 changed files with 3 additions and 2 deletions

View File

@ -72,7 +72,8 @@ function install_dependencies() {
function enable_php_lighttpd() {
install_log "Enabling PHP for lighttpd"
sudo lighty-enable-mod fastcgi-php || install_error "Cannot enable fastcgi-php for lighttpd"
sudo lighty-enable-mod fastcgi-php
if [ $? -eq 2 ]; then echo already enabled; else install_error "Cannot enable fastcgi-php for lighttpd"; fi
sudo /etc/init.d/lighttpd restart || install_error "Unable to restart lighttpd"
}
@ -92,7 +93,7 @@ function create_raspap_directories() {
# Fetches latest files from github to webroot
function download_latest_files() {
if [ -d "$webroot_dir" ]; then
sudo mv $webroot_dir $webroot.old || install_error "Unable to remove old webroot directory"
sudo mv $webroot_dir "$webroot_dir.old" || install_error "Unable to remove old webroot directory"
fi
install_log "Cloning latest files from github"