mirror of
				https://github.com/billz/raspap-webgui.git
				synced 2025-03-01 10:31:47 +00:00 
			
		
		
		
	Fix for #803 by @mp035
This commit is contained in:
		| @@ -208,14 +208,30 @@ function _install_lighttpd_configs() { | ||||
|  | ||||
|     # Copy config files | ||||
|     echo "Copying 50-raspap-router.conf to /etc/lighttpd/conf-available" | ||||
|     sudo cp "$webroot_dir/config/50-raspap-router.conf" "/etc/lighttpd/conf-available" || _install_status 1 "Unable to copy lighttpd config file." | ||||
|  | ||||
|     CONFSRC="$webroot_dir/config/50-raspap-router.conf" | ||||
|     LTROOT=$(grep "server.document-root" /etc/lighttpd/lighttpd.conf | awk -F '=' '{print $2}' | tr -d " \"") | ||||
|  | ||||
|     # compare values and get difference | ||||
|     HTROOT=${webroot_dir/$LTROOT} | ||||
|  | ||||
|     # remove trailing slash if present | ||||
|     HTROOT=$(echo "$HTROOT" | sed -e 's/\/$//') | ||||
|  | ||||
|     # substitute values | ||||
|     awk "{gsub(\"/REPLACE_ME\",\"$HTROOT\")}1" $CONFSRC > /tmp/50-raspap-router.conf | ||||
|  | ||||
|     # copy into place | ||||
|     sudo cp /tmp/50-raspap-router.conf /etc/lighttpd/conf-available/ || _install_status 1 "Unable to copy lighttpd config file into place." | ||||
|  | ||||
|     # link into conf-enabled | ||||
|     echo "Creating link to /etc/lighttpd/conf-enabled"|| _install_status 1 "Unable to copy lighttpd config file." | ||||
|     sudo ln -s "/etc/lighttpd/conf-available/50-raspap-router.conf" "/etc/lighttpd/conf-enabled/50-raspap-router.conf" || _install_status 1 "Unable to symlink lighttpd config file." | ||||
|     echo "Creating link to /etc/lighttpd/conf-enabled" | ||||
|     sudo ln -s "/etc/lighttpd/conf-available/50-raspap-router.conf" "/etc/lighttpd/conf-enabled/50-raspap-router.conf" || _install_status 1 "Unable to symlink lighttpd config file (this is normal if the link already exists)." | ||||
|     sudo systemctl restart lighttpd.service || _install_status 1 "Unable to restart lighttpd" | ||||
|     _install_status 0 | ||||
| } | ||||
|  | ||||
|  | ||||
| # Prompt to install ad blocking | ||||
| function _prompt_install_adblock() { | ||||
|     _install_log "Configure ad blocking (Beta)" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user