-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathweekly-manjaro
executable file
·52 lines (40 loc) · 983 Bytes
/
weekly-manjaro
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
#!/usr/bin/env bash
set -o nounset
set -o errexit
set -o pipefail
confirm() {
local msg=$1
while true; do
read -p "$msg (Y/n) " -r
case $REPLY in
Y | y | "")
return 0
;;
N | n)
return 1
;;
esac
done
}
# -------------------------------------------------
if confirm "update mirrors?"; then
pacman-mirrors --continent --method rank
fi
pacman -Syu
dangling_packages=$(pacman -Qdtq || :)
if [ -n "$dangling_packages" ]; then
# shellcheck disable=SC2086
pacman -Rns $dangling_packages
fi
pacman -Scc --noconfirm
# cleanup logs
journalctl --vacuum-size=50M
echo '-------------------------------------------------'
pacman -Ss 'kernel and modules' --color=always | grep --color=no 'core/'
echo '-------------------------------------------------'
echo 'sudo mhwd-kernel -i linux6x'
echo 'sudo mhwd-kernel -r linux6x'
echo '-------------------------------------------------'
if confirm "reboot?"; then
reboot
fi