-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbash_html.sh
More file actions
99 lines (99 loc) · 2.32 KB
/
bash_html.sh
File metadata and controls
99 lines (99 loc) · 2.32 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
INPUT=Acc_Info1.csv
OLDIFS=$IFS
IFS=";"
nm=""
eml=""
pswd=""
cno=""
cmo=""
cy=""
cv=""
f=$(mktemp XXXXXXXXXX.html)
[ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; }
i=0
while read name email password ccno ccmo ccy cvv
do
echo "[$i]|$name|$email|$password|$ccno|$ccmo|$ccy|$cvv|"
i=$((i+1))
done < $INPUT
IFS=$OLDIFS
read -p "Choose Account: " x
i=0
INPUT=Acc_Info1.csv
OLDIFS=$IFS
IFS=";"
[ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; }
while read name email password ccno ccmo ccy cvv
do
if [ "$i" = "$x" ]; then
nm=$name
eml=$email
pswd=$password
cno=$ccno
cmo=$ccmo
cy=$ccy
cv=$cvv
break
fi
i=$((i+1))
done < $INPUT
IFS=$OLDIFS
read -p "How many courses to choose from main link, main2 and extra links? (example: 2 1 3) " a b c
IFS=";" read -a ADDR < main_links.csv
IFS=";" read -a ADDR1 < main_links2.csv
IFS=";" read -a ADDR2 < extra_links.csv
count=1
A=()
while [ "$count" -le $a ] # Generate 10 ($MAXCOUNT) random integers.
do
number=$RANDOM
let "number %= ${#ADDR[@]}"
A+=(${ADDR[$number]})
let "count += 1" # Increment count.
done
count=1
B=()
while [ "$count" -le $b ] # Generate 10 ($MAXCOUNT) random integers.
do
number=$RANDOM
let "number %= ${#ADDR1[@]}"
B+=(${ADDR1[$number]})
let "count += 1" # Increment count.
done
count=1
C=()
while [ "$count" -le $c ] # Generate 10 ($MAXCOUNT) random integers.
do
number=$RANDOM
let "number %= ${#ADDR2[@]}"
C+=(${ADDR2[$number]})
let "count += 1" # Increment count.
done
echo "<!DOCTYPE html>" >> $f
echo "<html>\n" >> $f
echo " <body>" >> $f
echo " <h1>Name: $nm <br>Email: $eml <br>Password: $pswd<br>CC No. : $cno <br>CC Expiry date: $cmo/$cy <br>CVV: $cv</h1>" >> $f
echo " <h1><br> MAIN LINKS <br></h1>" >>$f
x=${#A[@]}
no=$((x-1))
for i in `seq 0 $no`;
do
echo " <a href=${A[$i]}>${A[$i]}<br></a> " >> $f
done
echo " <h1><br> MAIN LINKS 2<br></h1>" >>$f
x=${#B[@]}
no=$((x-1))
for i in `seq 0 $no`;
do
echo " <a href=${B[$i]}>${B[$i]}<br></a> " >> $f
done
echo " <h1><br> EXTRA LINKS <br></h1>" >>$f
x=${#C[@]}
no=$((x-1))
for i in `seq 0 $no`;
do
echo " <a href=${C[$i]}>${C[$i]}<br></a> " >> $f
done
echo " </body>" >> $f
echo "</html>" >> $f
google-chrome --no-sandbox /home/Automation/$f