mirror of https://github.com/OpenIPC/firmware.git
				
				
				
			disable/enable httpd basic-auth after debug flag set in camera environment.
							parent
							
								
									50f8ab4b19
								
							
						
					
					
						commit
						c9f8235f48
					
				|  | @ -2,12 +2,21 @@ | ||||||
| 
 | 
 | ||||||
| DAEMON="httpd" | DAEMON="httpd" | ||||||
| PIDFILE="/var/run/$DAEMON.pid" | PIDFILE="/var/run/$DAEMON.pid" | ||||||
|  | CONFFILE="/etc/httpd.conf" | ||||||
| 
 | 
 | ||||||
| HTTPD_ARGS="httpd -p 85 -f -c /etc/httpd.conf -r Authentication" | HTTPD_ARGS="httpd -p 85 -f -c $CONFFILE -r Authentication" | ||||||
| 
 | 
 | ||||||
| # shellcheck source=/dev/null | # shellcheck source=/dev/null | ||||||
| [ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON" | [ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON" | ||||||
| 
 | 
 | ||||||
|  | if [ "$(fw_printenv -n debug)" ]; then | ||||||
|  |   echo "Development mode. Disabling Basic Auth" | ||||||
|  |   sed -i "/^\/cgi-bin:admin:/s/^/#/" $CONFFILE | ||||||
|  | else | ||||||
|  |   echo "Production mode. Enabling Basic Auth" | ||||||
|  |   sed -i "/^#\/cgi-bin:admin:/s/^#//" $CONFFILE | ||||||
|  | fi | ||||||
|  | 
 | ||||||
| # The httpd does not create a pidfile, so pass "-n" in the command line | # The httpd does not create a pidfile, so pass "-n" in the command line | ||||||
| # and use "-m" to instruct start-stop-daemon to create one. | # and use "-m" to instruct start-stop-daemon to create one. | ||||||
| start() { | start() { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue