For pretty init-like output, I suggest looking at (or outright nicking) the LSB init functions shipped with pre-systemd Debian, Devuan, or any number of takes on the same idea by other distros from when they were running sysvinit.
Here's a related discussion from the archives, with a couple of (untested by me) example functions for colours, justification and such. Plenty more like it to be found on the 'net.
Not really sure why everyone wants their system startup scripts to have fancy colours and columns and whatnot TBH (how often are you going to look at this anyway?), but it's not a new desire.
Alternatively, why not just move all that over into systemd units (or your init/service manager of choice)? AFAICT you're not really doing much besides launching some daemons in order, so it shouldn't be much more effort than the pretty shell output route.
As a bonus, you'd get all the other bells and whistles that come with letting init handle things too, such as real process supervision rather than needing to muck about with idle loops and the like for crash handling.
As for the script itself, all those sleeps and sudo calls (uhh, why not just set file permissions properly at install time?)... Work, but pretty they are not. Then again, IME tolerance for shell kludges varies widely by individual, task-at-hand, and caffeine level.![Razz :P]()
Aside, @RedGreen925 Full-quoting makes thread very annoying to read.
Here's a related discussion from the archives, with a couple of (untested by me) example functions for colours, justification and such. Plenty more like it to be found on the 'net.
Not really sure why everyone wants their system startup scripts to have fancy colours and columns and whatnot TBH (how often are you going to look at this anyway?), but it's not a new desire.
Alternatively, why not just move all that over into systemd units (or your init/service manager of choice)? AFAICT you're not really doing much besides launching some daemons in order, so it shouldn't be much more effort than the pretty shell output route.
As a bonus, you'd get all the other bells and whistles that come with letting init handle things too, such as real process supervision rather than needing to muck about with idle loops and the like for crash handling.
As for the script itself, all those sleeps and sudo calls (uhh, why not just set file permissions properly at install time?)... Work, but pretty they are not. Then again, IME tolerance for shell kludges varies widely by individual, task-at-hand, and caffeine level.

Aside, @RedGreen925 Full-quoting makes thread very annoying to read.
Statistics: Posted by steve_v — 2024-05-19 00:51 — Replies 5 — Views 91