|
1 | 1 | #--------------------------------------------------------------------------------------------------------------- |
2 | 2 | #This script update and upgrade installed packages and also removed broken packages |
3 | 3 | #Building Date : 02/05/2021 |
4 | | -#Last Update : 02/05/2021 |
| 4 | +#Last Update : 03/05/2021 |
5 | 5 | #Builder : Bapon Kar |
6 | 6 | #Third Party packages : zenity which can installed by 'sudo apt update -y && sudo apt install zenity -y' command |
7 | 7 | #Download from : https://github.com/baponkar/gui_update.sh |
|
32 | 32 | bell_sound |
33 | 33 | echo -e "$r Please run \'~$ sudo apt install zenity\'\n before run this script $u" #zenity installation command |
34 | 34 | zenity --warning --text="No Zenity packages found" --width=320 --height=150 --timeout=3 --title="GUI Update & Upgrade" |
| 35 | + bell_sound |
35 | 36 | zenity --question --text="Do you like to installed it in your machine?" --width=320 --height=150 --timeout=5 --title="GUI Update & Upgrade" |
36 | 37 | if [[ $? -eq 0 ]] |
37 | 38 | then |
|
74 | 75 |
|
75 | 76 | if [[ -s error.txt ]] |
76 | 77 | then |
| 78 | + bell_sound |
77 | 79 | zenity --text-info --filename="error.txt" --text="Error" --width=320 --height=150 --title="GUI Update & Upgrade" |
78 | 80 | 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" |
80 | 84 | fi |
81 | 85 |
|
82 | 86 | rm -r error.txt |
83 | 87 | 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