-
-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathinsert-filter-remove-parameter.sh
More file actions
executable file
·38 lines (28 loc) · 887 Bytes
/
insert-filter-remove-parameter.sh
File metadata and controls
executable file
·38 lines (28 loc) · 887 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
#!/bin/bash
declare blocklist="./blocklist.txt"
read -p "Enter the parameter that you want to remove on all domains: " param
declare blocklistRule="*\$removeparam=${param}"
echo $blocklistRule
if [ "$param" == "v" ]; then
exit
fi
if [ "$param" == "[A[A" ]; then
echo "syntax error [A[A."
exit
fi
if [ "$param" == "" ]; then
echo "No parameter provided"
exit
fi
if grep -q "$blocklistRule" "$blocklist"; then
echo "Rule already present"
else
echo "checking for updates..."
git pull origin master && git pull github master
if grep -q "$blocklistRule" "$blocklist"; then
echo "This rule has already been added before you"
else
printf "$blocklistRule\n" >> "$blocklist"
git commit -am "remove parameter ${param}" && git push origin master && git push github master
fi
fi