From bb8f7516066bcd3ea36ce616da0adcbb1f037b26 Mon Sep 17 00:00:00 2001 From: Marc Date: Tue, 15 Feb 2022 12:22:27 +0100 Subject: [PATCH] =?UTF-8?q?Debuggage=20du=20init.d=20et=20d=C3=A9placement?= =?UTF-8?q?=20du=20logo=20vers=20etc/init.d/logo.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rootfs overrides/chibrax/initd.js | 5 ++--- rootfs overrides/etc/init.d/logo.js | 33 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 rootfs overrides/etc/init.d/logo.js diff --git a/rootfs overrides/chibrax/initd.js b/rootfs overrides/chibrax/initd.js index aa2f525..f8f1168 100644 --- a/rootfs overrides/chibrax/initd.js +++ b/rootfs overrides/chibrax/initd.js @@ -36,13 +36,12 @@ async function init() { i += 1 if(isSubSet(s.after, finishedScripts) && ( !befores[s.name] || isSubSet(befores[s.name], finishedScripts) )) { //on supprime ce service - scripts.splice(scripts.indexOf(s)) - + scripts.splice(scripts.indexOf(s), 1) const result = s.init() if(typeof result?.then === 'function') { await result + finishedScripts.push(s.name) } - finishedScripts.push(s.name) } } } diff --git a/rootfs overrides/etc/init.d/logo.js b/rootfs overrides/etc/init.d/logo.js new file mode 100644 index 0000000..7a6feef --- /dev/null +++ b/rootfs overrides/etc/init.d/logo.js @@ -0,0 +1,33 @@ +//async is optional but recomended for optimisation (optimisations are yet to be implemented) +async function init() { + //code to execute + console.log(` + _______ _________ ______ _______ _______ + ( ____ \\|\\ /|\\__ __/( ___ \\ ( ____ )( ___ )|\\ /| + | ( \\/| ) ( | ) ( | ( ) )| ( )|| ( ) |( \\ / ) + | | | (___) | | | | (__/ / | (____)|| (___) | \\ (_) / + | | | ___ | | | | __ ( | __)| ___ | ) _ ( + | | | ( ) | | | | ( \\ \\ | (\\ ( | ( ) | / ( ) \\ + | (____/\\| ) ( |___) (___| )___) )| ) \\ \\__| ) ( |( / \\ ) + (_______/|/ \\|\\_______/|/ \\___/ |/ \\__/|/ \\||/ \\| + + _______ _______ + ( ___ )( ____ \\ + | ( ) || ( \\/ + | | | || (_____ + | | | |(_____ ) + | | | | ) | + | (___) |/\\____) | + (_______)\\_______) + + `) +} + +const after = [] // list of init script to load before +const before = [] + +module.exports = { + init, + after, + before +} \ No newline at end of file