blob: 33044b7f8732a44bb13ef579307246d0c8ef8610 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
#!/bin/sh
#
# Startup/shutdown script for the gmid gemini service.
#
create_run_dir() {
if [ ! -d /run/gmid/ ]; then
mkdir -p /run/gmid
chown :gmid /run/gmid
chmod g+wX /run/gmid
fi
}
start() {
echo "Starting gmid gemini service"
create_run_dir
sudo -u gmid -- gmid \
-c /etc/gmid/gmid.conf \
-P /run/gmid/gmid.pid
}
status() {
create_run_dir
if [ -f /run/gmid/gmid.pid ] && [ kill -0 "$(cat /run/gmid/gmid.pid)" >/dev/null ]; then
echo "gmid is running"
else
echo "gmid is not running"
fi
}
stop() {
echo "Stopping gmid gemini service"
create_run_dir
if [ -f /run/gmid/gmid.pid ]; then
sudo -u gmid -- kill -SIGINT "$(cat /run/gmid/gmid.pid)"
fi
}
case "$1" in
start)
start
;;
status)
status
;;
stop)
stop
;;
*)
echo "Usage: $0 {start|stop|status}"
exit 1
esac
|