-
Notifications
You must be signed in to change notification settings - Fork 3
/
script.sh
executable file
·83 lines (65 loc) · 2.45 KB
/
script.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#! /bin/bash
clear
BLACK='\033[0;30m'
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
GRAY='\033[0;37m'
NC='\033[0m'
echo -e "${GREEN}"
echo " _____ _____ ____ _____ __ _ "
echo " / ____|_ _| _ \ / ____| / _(_) "
echo " | (___ | | | |_) | | | ___ _ __ | |_ _ __ _ "
echo " \___ \ | | | _ < | | / _ \| '_ \| _| |/ _ |"
echo " ____) |_| |_| |_) | | |___| (_) | | | | | | | (_| |"
echo " |_____/|_____|____/ \_____\___/|_| |_|_| |_|\__, |"
echo " __/ |"
echo " |___/"
echo -e "${NC}"
echo "[#] System Information Block Setting API"
while true
do
echo -e "${PURPLE}[!] Killing Process...\n${NC}"
sudo pkill srsepc
sudo pkill srsenb
echo "------------------------------------"
printf "${YELLOW}[?] which type of SIB would like to use? (10/11/12/[Q]uit): ${NC}"
read sib_type
if [ $sib_type == "q" ] || [ $sib_type == "Q" ]; then
echo -e "${PURPLE}[!] Quit.\n${NC}"
break
elif [ $sib_type != "10" ] && [ $sib_type != "11" ] && [ $sib_type != "12" ]; then
echo -e "${RED}[X] Please Select Correct Type of SIB.\n${NC}"
continue
fi
echo -e "[!] Switch to ${CYAN}SIB[$sib_type]${NC}.\n"
sudo sed -i "s/si_mapping_info = \[..\]/si_mapping_info = [$sib_type]/g" /etc/srslte/sib.conf
if [ $sib_type == "10" ]; then
echo -e "${GREEN}[*] Running Program...${NC}"
sudo srsepc &
sudo srsenb
echo -e "${GREEN}[!] End of Program.\n${NC}"
elif [ $sib_type == "11" ]; then
printf "${YELLOW}[?] Type the Message which you would like to alert: ${NC}"
IFS="" read -r message
echo -e "[*] Execute JavaScript...\n"
node parser.js $message
echo -e "${GREEN}[*] Running Program...${NC}"
sudo srsepc &
sudo srsenb
echo -e "${GREEN}[!] End of Program.\n${NC}"
elif [ $sib_type == "12" ]; then
printf "${YELLOW}[?] Type the Message which you would like to alert: ${NC}"
IFS="" read -r message
echo -e "[*] Execute JavaScript...\n"
node parser.js $message
echo -e "${GREEN}[*] Running Program...${NC}"
sudo srsepc &
sudo srsenb
echo -e "${GREEN}[!] End of Program.\n${NC}"
fi
done
echo -e "${GREEN}[!] Exiting the API...${NC}\n"