View Single Post
Posts: 97 | Thanked: 318 times | Joined on Feb 2012 @ Switzerland
#596
Originally Posted by claustn View Post
How to run the script at startup now? I'm trying to understand how systemd works but I'm not sure yet.
I created a systemd service that I use for all my 'tuning' during boot. The initial post can be found here...

With this you should be able to create your own service. The actual script would then look something like this...

Code:
#!/bin/bash

## bt-sleep-monitor service script

start() {
    /home/nemo/bt-sleep-monitor.sh &
}

stop() {
    killall bt-sleep-monitor.sh dbus-monitor
}

case "$1" in
    start)
	start
	;;
    stop)
	stop
	;;
    restart)
	stop
	sleep 1
        start
	;;
    *) exit 1
esac
 

The Following 2 Users Say Thank You to minimec For This Useful Post: