-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdateAllAndClean.sh
64 lines (56 loc) · 1.38 KB
/
updateAllAndClean.sh
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
#!/bin/bash
CYAN=`tput setaf 6`
RED=`tput setaf 1`
RESET=`tput sgr0`
BOLD=`tput bold`
function tellMe() {
echo ""
echo -e "${BOLD}${RED}*************************************************************"
echo -e "${CYAN}$1"
echo -e "${RED}*************************************************************${RESET}"
echo ""
}
function runUpdates() {
tellMe "GETTING UPDATE INFO"
sudo apt-get update
tellMe "UPDATING APPS"
sudo apt-get -y upgrade
tellMe "UPDATING SYSTEM"
sudo apt-get -y dist-upgrade
tellMe "UPDATING SNAP PACKAGES"
sudo snap refresh
tellMe "UPDATING FLATPAK PACKAGES"
sudo flatpak update
}
function cleanup() {
tellMe "REMOVING UNUSED DEPENDENCIES"
sudo apt -y autoremove
tellMe "REMOVING ANY PARTIAL PACKAGES"
sudo apt autoclean
tellMe "CLEANING APT CACHE"
sudo apt clean
}
function runExtras() {
# Put whatever extra scripts you want here
# these will run last
tellMe "CHECKING ANALOGUE POCKET UPDATES"
node ~/code/PERSONAL_GL/pocket-update-notifier/index.mjs
tellMe "FETCHING WEATHER"
curl wttr.in/<your_city_here>
# example: curl wttr.in/boston
}
function askCleanup() {
while true; do
tellMe "CLEANUP STUFF"
read -p "Do you wish to cleanup unused dependencies and cache? " yn
case $yn in
[Yy]* ) cleanup; break;;
[Nn]* ) break;;
* ) echo "Please answer (y)es or (n)o.";;
esac
done
}
runUpdates
askCleanup
runExtras
exit