openrc servicing
This commit is contained in:
parent
79230e7a88
commit
695eec653c
5
Makefile
5
Makefile
@ -11,6 +11,7 @@ endif
|
|||||||
|
|
||||||
LDLIBS := -lircclient
|
LDLIBS := -lircclient
|
||||||
|
|
||||||
|
INSTALL_TARGET := /etc/init.d/hibot
|
||||||
OUT := hibot
|
OUT := hibot
|
||||||
|
|
||||||
SOURCE.d := source/
|
SOURCE.d := source/
|
||||||
@ -28,5 +29,9 @@ run: ${OUT}
|
|||||||
test: ${OUT}
|
test: ${OUT}
|
||||||
${WRAP} ${OUT} irc.rizon.net:6665 "#/g/test"
|
${WRAP} ${OUT} irc.rizon.net:6665 "#/g/test"
|
||||||
|
|
||||||
|
install:
|
||||||
|
m4 script/hibot.m4 > ${INSTALL_TARGET}
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm ${OUT}
|
-rm ${OUT}
|
||||||
|
-rm ${INSTALL_TARGET}
|
||||||
|
19
script/hibot.m4
Normal file
19
script/hibot.m4
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
command_args="irc.rizon.net:6665 #/g/test"
|
||||||
|
|
||||||
|
name="hibot"
|
||||||
|
command="syscmd(`printf $(pwd)')/${name}"
|
||||||
|
pidfile="/var/run/${name}.pid"
|
||||||
|
|
||||||
|
start() {
|
||||||
|
ebegin "Starting $name"
|
||||||
|
start-stop-daemon --start --background --make-pidfile --pidfile "$pidfile" --exec "$command" -- $command_args
|
||||||
|
eend $?
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
ebegin "Stopping $name"
|
||||||
|
start-stop-daemon --stop --pidfile "$pidfile"
|
||||||
|
eend $?
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user