mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-22 07:30:23 +00:00
Install dhcpcd-base dependency + systemd unit control file
This commit is contained in:
parent
a26a3b665e
commit
1b3e1c3372
2 changed files with 29 additions and 11 deletions
|
@ -136,17 +136,6 @@ function _get_linux_distro() {
|
||||||
else
|
else
|
||||||
_install_status 1 "Unsupported Linux distribution"
|
_install_status 1 "Unsupported Linux distribution"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${OS,,} = "raspbian" ] && [[ ${RELEASE} =~ ^(12) ]]; then
|
|
||||||
echo "Detected OS: ${DESC} 32-bit"
|
|
||||||
echo "This OS introduces breaking changes to dhcpcd and is unsupported."
|
|
||||||
echo "If Raspberry Pi OS Lite (32-bit) is wanted, downgrade to bullseye."
|
|
||||||
echo "Note: Raspbian GNU/Linux 12 (bookworm) 64-bit is fully supported."
|
|
||||||
echo "See: https://docs.raspap.com/#compatible-operating-systems"
|
|
||||||
echo "The installer cannot continue."
|
|
||||||
_install_status 1 "Unsupported Linux distribution"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Sets php package option based on Linux version, abort if unsupported distro
|
# Sets php package option based on Linux version, abort if unsupported distro
|
||||||
|
@ -243,6 +232,11 @@ function _install_dependencies() {
|
||||||
echo "${dhcpcd_package} and ${iw_package} will be installed from the main deb sources list"
|
echo "${dhcpcd_package} and ${iw_package} will be installed from the main deb sources list"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ${OS,,} = "raspbian" ] && [[ ${RELEASE} =~ ^(12) ]]; then
|
||||||
|
dhcpcd_package="dhcpcd dhcpcd-base"
|
||||||
|
echo "${dhcpcd_package} will be installed from the main deb sources list"
|
||||||
|
fi
|
||||||
|
|
||||||
# Set dconf-set-selections
|
# Set dconf-set-selections
|
||||||
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
|
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
|
||||||
echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections
|
echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections
|
||||||
|
@ -633,6 +627,7 @@ function _check_for_old_configs() {
|
||||||
sudo ln -sf "${raspap_dir}/backups/${filename}.`date +%F-%R`" "${raspap_dir}/backups/${filename}"
|
sudo ln -sf "${raspap_dir}/backups/${filename}.`date +%F-%R`" "${raspap_dir}/backups/${filename}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
fi
|
fi
|
||||||
_install_status 0
|
_install_status 0
|
||||||
}
|
}
|
||||||
|
@ -668,7 +663,16 @@ function _default_configuration() {
|
||||||
if [ ! -f "$webroot_dir/includes/config.php" ]; then
|
if [ ! -f "$webroot_dir/includes/config.php" ]; then
|
||||||
sudo cp "$webroot_dir/config/config.php" "$webroot_dir/includes/config.php"
|
sudo cp "$webroot_dir/config/config.php" "$webroot_dir/includes/config.php"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ${OS,,} = "raspbian" ] && [[ ${RELEASE} =~ ^(12) ]]; then
|
||||||
|
echo "Moving dhcpcd systemd unit control file to /lib/systemd/system/"
|
||||||
|
sudo mv $webroot_dir/installers/dhcpcd.service /lib/systemd/system/ || _install_status 1 "Unable to move dhcpcd.service file"
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable dhcpcd.service || _install_status 1 "Failed to enable raspap.service"
|
||||||
|
fi
|
||||||
|
|
||||||
_install_status 0
|
_install_status 0
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
14
installers/dhcpcd.service
Normal file
14
installers/dhcpcd.service
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
[Unit]
|
||||||
|
Description=DHCP Client Daemon
|
||||||
|
Wants=network.target
|
||||||
|
Before=network-online.target
|
||||||
|
Documentation=man:dhcpcd(8)
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
ExecStart=/usr/sbin/dhcpcd -b -q
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Reference in a new issue