-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
42 lines (35 loc) · 754 Bytes
/
run
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
#!/bin/bash
function greenMessage {
echo -e "\\033[32;1m${@}\033[0m"
}
function redMessage {
echo -e "\\033[31;1m${@}\033[0m"
}
function yellowMessage {
echo -e "\\033[33;1m${@}\033[0m"
}
function blueMessage {
echo -e "\\033[34;1m${@}\033[0m"
}
if [ "$1" == "start" ];
then
greenMessage 'Starting...'
if screen -ls | grep -q chartGenerator;
then
redMessage 'Screen is already active!'
else
screen -AdmS chartGenerator php bot.php
blueMessage 'Done!'
fi
############################
elif [ "$1" == "stop" ];
then
greenMessage 'Stopping...'
if screen -ls | grep -q chartGenerator;
then
screen -X -S chartGenerator quit
blueMessage 'Done!'
else
redMessage 'Screen is already off!'
fi
fi