Fix raspap.service install path, add error handling

This commit is contained in:
billz 2020-03-20 08:04:50 +00:00
parent d1de71318b
commit 21273774a5
1 changed files with 6 additions and 4 deletions

View File

@ -294,10 +294,10 @@ function default_configuration() {
if [ ! -f "/etc/systemd/system/iptables.service" ]; then
echo "Enabling iptables.service"
sudo cp $webroot_dir/installers/iptables.service /etc/systemd/system/
sudo cp $webroot_dir/installers/iptables.service /etc/systemd/system/ || install_error "Unable to move iptables.service file"
sudo systemctl daemon-reload
sudo systemctl enable iptables.service
sudo systemctl start iptables.service
sudo systemctl enable iptables.service || install_error "Failed to enable iptables.service"
sudo systemctl start iptables.service || install_error "Unable to start iptables.service"
fi
# Prompt to install RaspAP daemon
@ -319,8 +319,10 @@ function default_configuration() {
function enable_raspap_daemon() {
install_log "Enabling RaspAP daemon"
echo "Disable with: sudo systemctl disable raspap.service"
sudo cp $webroot_dir/installers/raspap.service /lib/systemd/system/ || install_error "Unable to move raspap.service file"
sudo cp $webroot_dir/installers/raspap.service /etc/systemd/system/ || install_error "Unable to move raspap.service file"
sudo systemctl daemon-reload
sudo systemctl enable raspap.service || install_error "Failed to enable raspap.service"
sudo systemctl start raspap.service || intall_error "Unable to start raspap.service"
}
# Add a single entry to the sudoers file