Debuggage du init.d et déplacement du logo vers etc/init.d/logo.js

This commit is contained in:
Marc
2022-02-15 12:22:27 +01:00
parent 47e764132f
commit bb8f751606
2 changed files with 35 additions and 3 deletions
+2 -3
View File
@@ -36,15 +36,14 @@ async function init() {
i += 1 i += 1
if(isSubSet(s.after, finishedScripts) && ( !befores[s.name] || isSubSet(befores[s.name], finishedScripts) )) { if(isSubSet(s.after, finishedScripts) && ( !befores[s.name] || isSubSet(befores[s.name], finishedScripts) )) {
//on supprime ce service //on supprime ce service
scripts.splice(scripts.indexOf(s)) scripts.splice(scripts.indexOf(s), 1)
const result = s.init() const result = s.init()
if(typeof result?.then === 'function') { if(typeof result?.then === 'function') {
await result await result
}
finishedScripts.push(s.name) finishedScripts.push(s.name)
} }
} }
}
} }
/** /**
+33
View File
@@ -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
}