/
install
executable file
·77 lines (61 loc) · 2.14 KB
/
install
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh
##
# This script is to install DirectDemod
##
## variables
DIR="${HOME}/DirectDemod"
## Colours
RED='\033[0;31m'
BLUE='\033[0;34m'
GREEN='\033[0;32m'
YELLOW="\033[1;33m"
NC='\033[0m'
echo $YELLOW
cat << "EOF"
---------------------------------------------------------------
_____ _ _ _____ _
| __ \(_) | | | __ \ | |
| | | |_ _ __ ___ ___| |_| | | | ___ _ __ ___ ___ __| |
| | | | | '__/ _ \/ __| __| | | |/ _ \ '_ ` _ \ / _ \ / _` |
| |__| | | | | __/ (__| |_| |__| | __/ | | | | | (_) | (_| |
|_____/|_|_| \___|\___|\__|_____/ \___|_| |_| |_|\___/ \__,_|
EOF
echo "\n\nDirect Demodulation of Radio-signals by aerospaceresearch.net
https://github.com/aerospaceresearch/DirectDemod\n
---------------------------------------------------------------"
echo $NC
echo "This script will install DirectDemod into your system.
Following are the steps which will be executed in order
to install the DirectDemod, also note this script require
sudo access.
${GREEN}[Task 1]${NC} Clone https://github.com/aerospaceresearch/DirectDemod
to '${DIR}' folder.
${GREEN}[Task 2]${NC} Downloading all the dependencies.
${GREEN}[Task 3]${NC} Create a smbolic link between 'main.py' and CLI
command 'DirectDemod'.
${YELLOW}---------------------------------------------------------------${NC}"
echo "\n${GREEN}- Executing Task 1${NC}\n"
if [ ! -d $DIR ];
then
echo "Creating ${DIR}"
git clone https://github.com/aerospaceresearch/DirectDemod $DIR
elif [ ! -f "${DIR}/main.py" ];
then
echo "${DIR} already exist"
for FILE in "${DIR}/"
do
sudo rm -r "${FILE}"
done
git clone https://github.com/aerospaceresearch/DirectDemod $FILE
else
echo "else"
fi
printf "\n${GREEN}✔ Task 1 Complete!${NC}\n"
echo "\n${GREEN}- Executing Task 2${NC}\n"
pip install -r "${DIR}/requirements.txt" --user
printf "\n${GREEN}✔ Task 2 Complete!${NC}\n"
echo "\n${GREEN}- Executing Task 3${NC}\n"
chmod +x "${DIR}/main.py"
sudo ln -sf "${DIR}/main.py" "/usr/bin/DirectDemod"
echo "Creating smbolic link"
printf "\n${GREEN}✔ Task 3 Complete!${NC}\n"