-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathgisc.sh
executable file
·61 lines (54 loc) · 807 Bytes
/
gisc.sh
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
57
58
59
60
61
#!/bin/bash
#
# Run this script to start or stop gisc
#
# start gisc
#
start_cp()
{
echo 'starting'
folderPath=$(dirname $0)
cd "$folderPath"
conky -b -c conkyrc
conky -d -c conkyKeepRc &
}
#
# stop gisc
#
stop_cp()
{
echo 'stopping'
PID=$(ps -C conky a | grep 'gisc' | grep '\-d' | awk {'print $1'})
if [ -z "$PID" ]
then
echo "No running gisc instances found"
else
kill -9 $PID
fi
}
#
# print the manual
#
echo_manual()
{
echo '--- Usage ---'
echo 'Starting gisc: ./gisc.sh start'
echo 'Stopping gisc: ./gisc.sh stop'
echo 'Restarting gisc: ./gisc.sh restart'
}
if [ $1 ]; then
if [ $1 = "start" ]; then
start_cp
elif [ $1 = "stop" ]; then
stop_cp
elif [ $1 = "restart" ]; then
echo 'restarting'
stop_cp
start_cp
else
echo_manual
fi
else
echo_manual
fi
exit 0