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