forked from corpnewt/CorpBot.py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStart.command
More file actions
executable file
·46 lines (39 loc) · 800 Bytes
/
Start.command
File metadata and controls
executable file
·46 lines (39 loc) · 800 Bytes
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
#!/bin/bash
# Turn on case-insensitive matching
shopt -s nocasematch
# turn on extended globbing
shopt -s extglob
py_path="python3"
bot="WatchDog.py"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
function check_py () {
if [ -x "$(command -v python3)" ]; then
py_path="$(which python3)"
else
if [ -x "$(command -v python)" ]; then
py_path="$(which python)"
else
echo
exit 1
fi
fi
echo $py_path
}
function main () {
echo \#\#\# Starting CorpBot \#\#\#
cd "$DIR"
py_path="$(check_py)"
if [[ "$py_path" == "" ]]; then
echo
echo "Python is not installed!"
echo
exit 1
fi
runBot
}
function runBot () {
echo
"$py_path" "$bot"
echo
}
main