-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
63 lines (59 loc) · 1005 Bytes
/
start.sh
File metadata and controls
63 lines (59 loc) · 1005 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
SCRIPT_PATH=${0%/*}
PROGRAMM_DIR=tb_weather
PROGRAMM_NAME=tbweather.py
CLEAN_NAME=__pycache__
REQUIRETMENTS_NAME=requiretments.txt
PY=python
PIP=pip
ACTION=$1
run ()
{
cd $SCRIPT_PATH/$PROGRAMM_DIR/
$PY $PROGRAMM_NAME
}
clean ()
{
rm -rf $PROGRAMM_PATH/$CLEAN_NAME
}
requiretments ()
{
$PIP install -r $SCRIPT_PATH/$REQUIRETMENTS_NAME
}
help ()
{
echo " ~/start.sh <parameters>"
echo "-r |--run - Runing telegram weather bot."
echo "-c |--clean - Remove byte-compiled files by python."
echo "-rq|--requiretments - Install packages for telegram weather bot."
echo "-i |--install - Install and run telegram weather bot."
echo "-rb|--re-build - Re-building telegram weather bot."
echo "-h |--help - Output help message."
}
case $ACTION in
-r|--run)
run
;;
-c|--clean)
clean
;;
-rq|--requiretments)
requiretments
;;
-i|--install)
requiretments
run
;;
-rb|--re-build)
clean
run
;;
-h|--help)
help
;;
*)
echo "Enter incorrect action"
help
;;
esac
exit 0