Created
April 30, 2023 13:13
-
-
Save peterldowns/c0d1f7d7a966447b566facd78fa3e408 to your computer and use it in GitHub Desktop.
wsl2 service config for lorri daemon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Put this at /etc/init.d/lorri | |
# then you can do | |
# | |
# service lorri start | |
# service lorri status | |
# service lorri stop | |
# service lorri restart | |
# | |
# as a regular user | |
start() { | |
echo "starting lorri" | |
# Your username is necessary for some reason | |
USER=pd lorri daemon &>/var/log/lorri/lorri.log & | |
} | |
stop() { | |
echo "stopping lorri" | |
pkill lorri | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
stop | |
start | |
;; | |
status) | |
ps aux | grep lorri | grep -v grep | grep -v status | |
;; | |
*) | |
echo "Usage: $0 {start|stop|status|restart}" | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment