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

Conditional prompt for reboot

This commit is contained in:
billz 2019-04-07 22:13:05 +00:00
parent cc6fe6f2ac
commit 4d2d79b404

View File

@ -326,6 +326,9 @@ function optimize_php() {
function install_complete() { function install_complete() {
install_log "Installation completed!" install_log "Installation completed!"
# Prompt to reboot if wired ethernet (eth0) is connected.
# With default_configuration this will create an active AP on restart.
if ip a | grep -q ': eth0:.*state UP'; then
echo -n "The system needs to be rebooted as a final step. Reboot now? [y/N]: " echo -n "The system needs to be rebooted as a final step. Reboot now? [y/N]: "
read answer read answer
if [[ $answer != "y" ]]; then if [[ $answer != "y" ]]; then
@ -333,6 +336,7 @@ function install_complete() {
exit 0 exit 0
fi fi
sudo shutdown -r now || install_error "Unable to execute shutdown" sudo shutdown -r now || install_error "Unable to execute shutdown"
fi
} }
function install_raspap() { function install_raspap() {