mirror of
				https://github.com/billz/raspap-webgui.git
				synced 2025-03-01 10:31:47 +00:00 
			
		
		
		
	Detect Ubuntu 22.04, extended regex to match daemon_conf
This commit is contained in:
		| @@ -140,7 +140,7 @@ function _get_linux_distro() { | |||||||
| # Sets php package option based on Linux version, abort if unsupported distro | # Sets php package option based on Linux version, abort if unsupported distro | ||||||
| function _set_php_package() { | function _set_php_package() { | ||||||
|     case $RELEASE in |     case $RELEASE in | ||||||
|         20.04|18.04|19.10|11*) # Ubuntu Server, Debian 11 & Armbian 22.05 |         22.04|20.04|18.04|19.10|11*) # Ubuntu Server, Debian 11 & Armbian 22.05 | ||||||
|             php_package="php7.4-cgi" |             php_package="php7.4-cgi" | ||||||
|             phpcgiconf="/etc/php/7.4/cgi/php.ini" ;; |             phpcgiconf="/etc/php/7.4/cgi/php.ini" ;; | ||||||
|         10*|11*) |         10*|11*) | ||||||
| @@ -193,7 +193,7 @@ function _manage_systemd_services() { | |||||||
| function _install_dependencies() { | function _install_dependencies() { | ||||||
|     _install_log "Installing required packages" |     _install_log "Installing required packages" | ||||||
|     _set_php_package |     _set_php_package | ||||||
|     if [ "$php_package" = "php7.4-cgi" ] && [ ${OS,,} = "ubuntu" ] && [[ ${RELEASE} =~ ^(18.04|19.10|11) ]]; then |     if [ "$php_package" = "php7.4-cgi" ] && [ ${OS,,} = "ubuntu" ] && [[ ${RELEASE} =~ ^(22.04|20.04|18.04|19.10|11) ]]; then | ||||||
|         echo "Adding apt-repository ppa:ondrej/php" |         echo "Adding apt-repository ppa:ondrej/php" | ||||||
|         sudo apt-get install $apt_option software-properties-common || _install_status 1 "Unable to install dependency" |         sudo apt-get install $apt_option software-properties-common || _install_status 1 "Unable to install dependency" | ||||||
|         sudo add-apt-repository $apt_option ppa:ondrej/php || _install_status 1 "Unable to add-apt-repository ppa:ondrej/php" |         sudo add-apt-repository $apt_option ppa:ondrej/php || _install_status 1 "Unable to add-apt-repository ppa:ondrej/php" | ||||||
| @@ -560,7 +560,7 @@ function _default_configuration() { | |||||||
|         [ -d /etc/dnsmasq.d ] || sudo mkdir /etc/dnsmasq.d |         [ -d /etc/dnsmasq.d ] || sudo mkdir /etc/dnsmasq.d | ||||||
|  |  | ||||||
|         # Copy OS-specific bridge default config |         # Copy OS-specific bridge default config | ||||||
|         if [ ${OS,,} = "ubuntu" ] && [[ ${RELEASE} =~ ^(20.04|19.10|18.04) ]]; then |         if [ ${OS,,} = "ubuntu" ] && [[ ${RELEASE} =~ ^(22.04|20.04|19.10|18.04) ]]; then | ||||||
|             echo "Copying bridged AP config to /etc/netplan" |             echo "Copying bridged AP config to /etc/netplan" | ||||||
|             sudo cp $webroot_dir/config/raspap-bridge-br0.netplan /etc/netplan/raspap-bridge-br0.netplan || _install_status 1 "Unable to move br0 netplan file" |             sudo cp $webroot_dir/config/raspap-bridge-br0.netplan /etc/netplan/raspap-bridge-br0.netplan || _install_status 1 "Unable to move br0 netplan file" | ||||||
|         else |         else | ||||||
| @@ -651,12 +651,12 @@ function _patch_system_files() { | |||||||
|     sudo systemctl enable hostapd.service |     sudo systemctl enable hostapd.service | ||||||
|      |      | ||||||
|     # Set correct DAEMON_CONF path for hostapd (Ubuntu20 + Armbian22) |     # Set correct DAEMON_CONF path for hostapd (Ubuntu20 + Armbian22) | ||||||
|     if [ ${OS,,} = "ubuntu" ] && [[ ${RELEASE} =~ ^(20.04|19.10|18.04) ]]; then |     if [ ${OS,,} = "ubuntu" ] && [[ ${RELEASE} =~ ^(22.04|20.04|19.10|18.04) ]]; then | ||||||
|         conf="/etc/default/hostapd" |         conf="/etc/default/hostapd" | ||||||
|         key="DAEMON_CONF" |         key="DAEMON_CONF" | ||||||
|         value="/etc/hostapd/hostapd.conf" |         value="/etc/hostapd/hostapd.conf" | ||||||
|         echo "Setting default ${key} path to ${value}" |         echo "Setting default ${key} path to ${value}" | ||||||
|         sudo sed -i "/^$key/ { s/^#//; s%=.*%=\"$value\"%; }" "$conf" || _install_status 1 "Unable to set value in ${conf}" |         sudo sed -i -E "/^#?$key/ { s/^#//; s%=.*%=\"$value\"%; }" "$conf" || _install_status 1 "Unable to set value in ${conf}" | ||||||
|     fi |     fi | ||||||
|     _install_status 0 |     _install_status 0 | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user