mirror of https://github.com/OpenIPC/firmware.git
				
				
				
			[no ci] Package: update webui makefile (#1296)
							parent
							
								
									47a119121e
								
							
						
					
					
						commit
						07d9098754
					
				|  | @ -1,31 +1,21 @@ | |||
| #!/bin/sh | ||||
| 
 | ||||
| DAEMON="majestic" | ||||
| DAEMON_PATH="/usr/bin" | ||||
| PIDFILE="/var/run/$DAEMON.pid" | ||||
| 
 | ||||
| DAEMON_ARGS="-s" | ||||
| 
 | ||||
| # shellcheck source=/dev/null | ||||
| [ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON" | ||||
| 
 | ||||
| load_majestic() { | ||||
| 	printf 'Starting %s: ' "$DAEMON" | ||||
| 	[ -f $DAEMON_PATH/$DAEMON ] || echo -en "DISABLED, " | ||||
| 	# shellcheck disable=SC2086 # we need the word splitting | ||||
| 
 | ||||
| 	[ -f /etc/coredump.conf ] && . /etc/coredump.conf | ||||
| 	if [ "$coredump_enabled" ]; then | ||||
| 		[ "$(cli -g .watchdog.timeout)" -lt "30" ] && cli -s .watchdog.timeout 30 | ||||
| 		ulimit -c unlimited && echo "|/usr/sbin/sendcoredump.sh" >/proc/sys/kernel/core_pattern | ||||
| 	fi | ||||
| 
 | ||||
| 	if [ "ingenic" = "$(ipcinfo -v)" ] && [ -f /etc/webui/imp.conf ]; then | ||||
| 		start-stop-daemon -b -m -S -q -p "$PIDFILE" -x /usr/bin/env -- \ | ||||
| 			LD_PRELOAD=/usr/lib/libimp_control.so $DAEMON_PATH/$DAEMON $DAEMON_ARGS | ||||
| 	else | ||||
| 		start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "$DAEMON_PATH/$DAEMON" -- $DAEMON_ARGS | ||||
| 	fi | ||||
| 
 | ||||
| 	start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" -- $DAEMON_ARGS | ||||
| 	status=$? | ||||
| 	if [ "$status" -eq 0 ]; then | ||||
| 		echo "OK" | ||||
|  | @ -35,7 +25,6 @@ load_majestic() { | |||
| 	return "$status" | ||||
| } | ||||
| 
 | ||||
| # The daemon does not create a pidfile, and use "-m" to instruct start-stop-daemon to create one. | ||||
| start() { | ||||
| 	logger -s -p daemon.info -t $(ipcinfo -v) "Loading video system has started..." | ||||
| 	export SENSOR=$(fw_printenv -n sensor) | ||||
|  | @ -56,21 +45,18 @@ stop() { | |||
| 	return "$status" | ||||
| } | ||||
| 
 | ||||
| restart() { | ||||
| 	stop || true | ||||
| 	sleep 1 | ||||
| 	reload | ||||
| } | ||||
| 
 | ||||
| reload() { | ||||
| 	load_majestic | ||||
| } | ||||
| 
 | ||||
| case "$1" in | ||||
| 	start|stop|restart|reload) | ||||
| 	start|stop) | ||||
| 		"$1" | ||||
| 		;; | ||||
| 
 | ||||
| 	restart) | ||||
| 		stop | ||||
| 		load_majestic | ||||
| 		;; | ||||
| 
 | ||||
| 	*) | ||||
| 		echo "Usage: $0 {start|stop|restart|reload}" | ||||
| 		echo "Usage: $0 {start|stop|restart}" | ||||
| 		exit 1 | ||||
| 		;; | ||||
| esac | ||||
|  |  | |||
|  | @ -2,7 +2,5 @@ config BR2_PACKAGE_WEBUI | |||
| 	bool "webui" | ||||
| 	select BR2_PACKAGE_HASERL | ||||
| 	help | ||||
| 	  The simplest web interface constructor based on | ||||
| 	  httpd and haserl. | ||||
| 
 | ||||
| 	  Simple web interface based on httpd and haserl. | ||||
| 	  https://openipc.org | ||||
|  |  | |||
|  | @ -3,7 +3,6 @@ | |||
| DAEMON="httpd" | ||||
| PIDFILE="/var/run/$DAEMON.pid" | ||||
| CONFFILE="/etc/httpd.conf" | ||||
| 
 | ||||
| HTTPD_ARGS="httpd -p 85 -f -c $CONFFILE -r Authentication" | ||||
| 
 | ||||
| # shellcheck source=/dev/null | ||||
|  | @ -23,8 +22,7 @@ start() { | |||
| 	printf 'Starting %s: ' "$DAEMON" | ||||
| 	[ -f /usr/sbin/$DAEMON ] || echo -en "DISABLED, " | ||||
| 	# shellcheck disable=SC2086 # we need the word splitting | ||||
| 	start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/sbin/$DAEMON" \ | ||||
| 		-- $HTTPD_ARGS | ||||
| 	start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/sbin/$DAEMON" -- $HTTPD_ARGS | ||||
| 	status=$? | ||||
| 	if [ "$status" -eq 0 ]; then | ||||
| 		echo "OK" | ||||
|  | @ -56,10 +54,13 @@ restart() { | |||
| 
 | ||||
| case "$1" in | ||||
| 	start|stop|restart) | ||||
| 		"$1";; | ||||
| 		"$1" | ||||
| 		;; | ||||
| 
 | ||||
| 	reload) | ||||
| 		# Restart, since there is no true "reload" feature. | ||||
| 		restart;; | ||||
| 		restart | ||||
| 		;; | ||||
| 
 | ||||
| 	*) | ||||
| 		echo "Usage: $0 {start|stop|restart|reload}" | ||||
| 		exit 1 | ||||
|  | @ -12,11 +12,10 @@ WEBUI_LICENSE_FILES = LICENSE | |||
| 
 | ||||
| define WEBUI_INSTALL_TARGET_CMDS | ||||
| 	$(INSTALL) -m 755 -d $(TARGET_DIR)/etc | ||||
| 	cp $(WEBUI_PKGDIR)/files/httpd.conf $(TARGET_DIR)/etc | ||||
| 	$(INSTALL) -m 644 -t $(TARGET_DIR)/etc $(WEBUI_PKGDIR)/files/etc/* | ||||
| 
 | ||||
| 	$(INSTALL) -m 755 -d $(TARGET_DIR)/etc/init.d | ||||
| 	cp $(WEBUI_PKGDIR)/files/S50httpd $(TARGET_DIR)/etc/init.d | ||||
| 	cp -rv $(@D)/files/etc/init.d/* $(TARGET_DIR)/etc/init.d | ||||
| 	$(INSTALL) -m 755 -t $(TARGET_DIR)/etc/init.d $(WEBUI_PKGDIR)/files/init.d/* | ||||
| 
 | ||||
| 	$(INSTALL) -m 755 -d $(TARGET_DIR)/usr | ||||
| 	cp -rv $(@D)/files/usr/sbin $(TARGET_DIR)/usr | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue