-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrebash
69 lines (68 loc) · 1.45 KB
/
rebash
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
#! /bin/bash/
function rebash()
{
echo -e "Run Update BEFORE Upgrade"
select rebashchoice in "Reset BASH" "Update Menu" "Upgrade Menu"
do
case "$rebashchoice" in
"Reset BASH")
clear
source ~/.bashrc || return
return
;;
"Update Menu")
select updatechoice in "Update Sources" "NetSelect Best Source"
do
case "$updatechoice" in
"Update Sources")
sudo apt update || return
return
;;
"NetSelect Best Source")
cd ~/GIT
if ls "sources.list"
then
echo "Removing old sources"
rm sources.list
else
echo "old sources.list not found"
fi
echo "Creating new sources list"
sudo netselect-apt -sn
return
;;
esac
done
return
;;
"Upgrade Menu")
select upgradechoice in "List Upgrades" "List Upgrades with Detail" "Run Safe-Upgrade" "Run Full-Upgrade" "Autoremove Unrequired"
do
case "$upgradechoice" in
"List Upgrades")
apt list --upgradable 2>/dev/null | cut -d/ -f1 | sort | column
return
;;
"List Upgrades with Detail")
sudo apt list --upgradeable
return
;;
"Run Safe-Upgrade")
sudo apt upgrade || return
return
;;
"Run Full-Upgrade")
sudo apt full-upgrade || return
return
;;
"Autoremove Unrequired")
sudo apt autoremove || return
return
;;
esac
done
return
;;
esac
done
}