Skip to content

Commit 793e2af

Browse files
authored
Adding rkhunter security check in gui_update_1.sh file
This script now having security check option.
1 parent 1748348 commit 793e2af

1 file changed

Lines changed: 61 additions & 2 deletions

File tree

gui_update_1.sh

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#---------------------------------------------------------------------------------------------------------------
22
#This script update and upgrade installed packages and also removed broken packages
33
#Building Date : 02/05/2021
4-
#Last Update : 02/05/2021
4+
#Last Update : 03/05/2021
55
#Builder : Bapon Kar
66
#Third Party packages : zenity which can installed by 'sudo apt update -y && sudo apt install zenity -y' command
77
#Download from : https://github.com/baponkar/gui_update.sh
@@ -32,6 +32,7 @@ then
3232
bell_sound
3333
echo -e "$r Please run \'~$ sudo apt install zenity\'\n before run this script $u" #zenity installation command
3434
zenity --warning --text="No Zenity packages found" --width=320 --height=150 --timeout=3 --title="GUI Update & Upgrade"
35+
bell_sound
3536
zenity --question --text="Do you like to installed it in your machine?" --width=320 --height=150 --timeout=5 --title="GUI Update & Upgrade"
3637
if [[ $? -eq 0 ]]
3738
then
@@ -74,10 +75,68 @@ fi
7475

7576
if [[ -s error.txt ]]
7677
then
78+
bell_sound
7779
zenity --text-info --filename="error.txt" --text="Error" --width=320 --height=150 --title="GUI Update & Upgrade"
7880
else
79-
zenity --info --text="The Script runs successfully!\n There is no Error!" --width=320 --height=150 --title="GUI Update & Upgrade"
81+
bell_sound
82+
zenity --info --text="The Update and Upgrade of packages runs successfully!\n There is no Error!" --width=320 --height=150 \
83+
--timeout=2 --title="GUI Update & Upgrade"
8084
fi
8185

8286
rm -r error.txt
8387
rm -r success.txt
88+
#---------------------------------------------------------------------------------------------------------------------------------
89+
#security check by rkhunter
90+
zenity --question --text="Do you like to security check in your machine?" --width=320 --height=150 --timeout=5 \
91+
--title="GUI Update & Upgrade"
92+
if [[ $? -eq 0 ]]
93+
then
94+
rkhunter --version
95+
if [[ $? -eq 0 ]]
96+
then
97+
98+
echo "$pass" | sudo -S rkhunter --sk --propupd | zenity --progress --pulsate --text="Security checking..."\
99+
--width=320 --height=150 --title="GUI UPDATE & Upgrade" --auto-close --auto-kill
100+
echo "$pass" | sudo -S rkhunter --sk -c | zenity --progress --pulsate --text="Security checking..."\
101+
--width=320 --height=150 --title="GUI UPDATE & Upgrade" --auto-close --auto-kill
102+
touch temp
103+
echo -e "The rkhunter security risks.\n" >> temp
104+
now=$(date +%d%m%Y%r)
105+
echo "System last run : $now" >> temp
106+
cat -n /var/log/rkhunter.log | grep -i warning >> temp
107+
108+
zenity --text-info --filename="temp" --text="Security Warning!" --width=650 --height=350 \
109+
--title="GUI Update & Upgrade"
110+
rm -r temp
111+
112+
113+
114+
115+
else
116+
bell_sound
117+
zenity --warning --text="No rkhunter package found" --width=320 --height=150 --timeout=3 \
118+
--title="GUI Update & Upgrade" --timeout=2
119+
bell_sound
120+
zenity --question --text="Do you like to install rkhunter in your machine?" --width=320 --height=150 \
121+
--timeout=5 --title="GUI Update & Upgrade"
122+
if [[ $? -eq 0 ]]
123+
then
124+
#pass=$(zenity --password --width=320 --height=150 --timeout=10 --title="GUI Update & Upgrade")
125+
$pass | sudo apt install rkhunter -y 2>> error.txt
126+
if [[ $? -eq 0 ]]
127+
then
128+
bell_sound
129+
zenity --info --text="The rkhunter installed successfully.Now run again this script." \
130+
--width=320 --height=150 --title="GUI Update & Upgrade" --timeout=3
131+
else
132+
bell_sound
133+
zenity --text-info --filename="error.txt" --text="Error" --width=320 --height=150 -\
134+
-title="GUI Update & Upgrade"
135+
fi
136+
else
137+
exit
138+
139+
fi
140+
141+
fi
142+
fi

0 commit comments

Comments
 (0)