Browse Source

fixed frontend look cases where lask_opk file could be removed after the instant action SIGUSR1 signal

Vincent-FK 2 years ago
parent
commit
2ae4604084
1 changed files with 4 additions and 2 deletions
  1. 4 2
      FunKey/board/funkey/rootfs-overlay/usr/local/sbin/frontend

+ 4 - 2
FunKey/board/funkey/rootfs-overlay/usr/local/sbin/frontend

@@ -71,14 +71,16 @@ init_frontend() {
     while true; do
 	
 		# Check if frontend disable file is present
-		if [ -f "${DISABLE_FRONTEND_FILE}" ]; then
+		if [ -f "${DISABLE_FRONTEND_FILE}" -o -f "${REBOOTING_FILE}" ]; then
 		    echo "${DISABLE_FRONTEND_FILE} file found, not starting frontend" 
 		    sleep 5
 		else
 
 		    # Umount any remaining OPK, if any
 		    umount /opk >/dev/null 2>&1
-		    rm -f "${LAST_OPK_FILE}"
+		    if [ -r "${LAST_OPK_FILE}" -a ! -f "${REBOOTING_FILE}" ]; then
+				rm "${LAST_OPK_FILE}"
+		    fi
 
 		    # Launch selected frontend
 	    	local frontend="$(get_frontend)"