OSDN Git Service

66boot-initial-setup: remove the warning from the conf file.
authormobinmob <mobinmob@disroot.org>
Sat, 27 Feb 2021 23:22:41 +0000 (00:22 +0100)
committermobinmob <mobinmob@disroot.org>
Sat, 27 Nov 2021 16:53:41 +0000 (18:53 +0200)
srcpkgs/boot-66serv/files/66boot-initial-setup

index 513f614..0d809c8 100644 (file)
@@ -17,8 +17,10 @@ msg_trees() {
 # Enable the boot@system service in the boot tree.
 66-enable -F -t boot boot@system || msg_trees
 # Copy the default boot@conf so that is will survive updates and be accesible
-#  though /etc/66rc.conf.
-[ ! -f /etc/66/conf/boot@system/version/boot@system ] && cp /etc/66/conf/boot@system/version/.boot@system /etc/66/conf/boot@system/version/boot@system
+# though /etc/66rc.conf. Also, remove the warning in the first lines of the file.
+[ ! -f /etc/66/conf/boot@system/version/boot@system ] && cp /etc/66/conf/boot@system/version/.boot@system /etc/66/conf/boot@system/version/boot@system && \
+warn=$( sed -n -e "/##\ \[STARTWARN\]/p" /etc/66rc.conf | tr -d '[:space:]') && \
+ [ "$warn" = "##[STARTWARN]" ] && sed -i '1,5d' /etc/66rc.conf
 
 # Create default tree, enable it and make it current.
 66-tree -nEc default || msg_trees