1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

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

View File

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