
19 Feb
2022
19 Feb
'22
10:06 p.m.
On Sat, 19 Feb 2022 08:54:29 +0000, Warren Boyd wrote:
#!/bin/bash # chkconfig: 2345 # description: Set the battery charge threshold
start() { echo 50 > /sys/class/power_supply/BAT0/charge_control_end_threshold }
case "$1" in start) start ;; stop) restart) ;; *) echo "Usage: $0 {start|stop|restart}" esac
exit 0
That’s 20 lines (17 excluding blank ones), nearly all of which is repetitive boilerplate. You’ll note the one I posted was just 12, including blank lines, of which only one was actual executable code (all the rest were directives).
I'm just trying to gauge how systemd makes this an easy customization of the system compared to what came before it.
Hopefully that answers your question ...