Move old install directory if it exists

pull/4/head
Joe Haig 9 years ago
parent 3a958e3f3b
commit b8b3fd1d31

@ -64,9 +64,10 @@ function enable_php_lighttpd() {
# Verifies existence and permissions of RaspAP directory
function create_raspap_directories() {
install_log "Creating RaspAP directories"
if [ ! -d "$raspap_dir" ]; then
sudo mkdir -p "$raspap_dir" || install_error "Unable to create directory '$raspap_dir'"
if [ -d "$raspap_dir" ]; then
sudo mv $raspap_dir $raspap_dir.original || install_error "Unable to move old directory out of the way"
fi
sudo mkdir -p "$raspap_dir" || install_error "Unable to create directory '$raspap_dir'"
sudo chown -R $raspap_user:$raspap_user "$raspap_dir" || install_error "Unable to change file ownership for '$raspap_dir'"
}

Loading…
Cancel
Save