File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # ---------------------------------------------------------------------------------------------------------------
2+ # This script update and upgrade installed packages and also removed broken packages
3+ # Building Date : 02/05/2021
4+ # Last Update : 02/05/2021
5+ # Builder : Bapon Kar
6+ # Third Party packages : zenity which can installed by 'sudo apt update -y && sudo apt install zenity -y' command
7+ # Download from : https://github.com/baponkar/gui_update.sh
8+ # License : GNU GPL v 3.0
9+ # ---------------------------------------------------------------------------------------------------------------
10+
11+
12+ #! /bin/bash
13+
14+
15+ # Checking either zwnity installed or not
16+ zenity --version
17+ if [[ $? -ne 0 ]]
18+ then
19+ echo -e " Please run \'~$ sudo apt install zenity\'\n before run this script" # zenity installation command
20+ else
21+ pass=$( zenity --password --width=320 --height=150 --timeout=10 --title=" GUI Update & Upgrade" ) # Storing password into pass variable
22+ (
23+ echo 25
24+ echo " # Updating..."
25+ echo " $pass " | sudo -S apt-get update -y 1> success.txt 2> error.txt
26+
27+ echo 30
28+ echo " # Upgrading..."
29+ echo " $pass " | sudo -S apt-get upgrade -y 1>> success.txt 2>> error.txt
30+
31+ echo 70
32+ echo " # Dist. Upgrading.."
33+ echo " $pass " | sudo -S apt-get dist-upgrade -y 1>> success.txt 2>> error.txt
34+
35+ echo 90
36+ echo " # Cleaning..."
37+ echo " $pass " | sudo -S apt-get autoclean -y 1>> success.txt 2>> error.txt
38+
39+ echo 95
40+ echo " # Removing..."
41+ echo " $pass " | sudo -S apt-get autoremove -y 1>> success.txt 2>> error.txt
42+
43+ echo 100
44+ echo " # All Done!"
45+
46+ ) | zenity --title " GUI Update & Upgrade Bash script.." --progress --auto-close --auto-kill --width=320 --height=150 --title=" GUI Update & Upgrade"
47+
48+ fi
49+
50+ if [[ -s error.txt ]]
51+ then
52+ zenity --text-info --filename=" error.txt" --text=" Error" --width=320 --height=150 --title=" GUI Update & Upgrade"
53+ else
54+ zenity --info --text=" The Script runs successfully!\n There is no Error!" --width=320 --height=150 --title=" GUI Update & Upgrade"
55+ fi
56+
57+ rm -r error.txt
58+ rm -r success.txt
You can’t perform that action at this time.
0 commit comments