Update maintenance script

This commit is contained in:
2024-01-05 19:20:01 +00:00
parent 0fdac6c705
commit 21f498b029
3 changed files with 29 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
#! /bin/bash
echo -e "\e[31m[+] Upgrading Arch...\e[0m"
echo -e "\e[31m[+] Upgrading...\e[0m"
sudo paru -Syu
echo -e "\e[31m[+] Cleaning orphaned (unneeded) packages...\e[0m"

View File

@@ -0,0 +1,15 @@
#! /bin/bash
echo -e "\e[31m[+] Upgrading...\e[0m"
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremove
sudo apt autoclean
echo -e "\e[31m[+] Removing logs older than 7d...\e[0m"
sudo journalctl --vacuum-time=7d
echo -e "\e[31m[I] Cleaning flatpak...:\e[0m"
flatpak remove --unused
read -p "Press enter to exit."

View File

@@ -6,6 +6,7 @@
# p r package -> remove package
# p c package -> check if package is installed (0 -> installed; 1 -> not installed; 2 -> ERROR)
# d -> returns 1 -> Debian; 2 -> Arch; 0 -> Error
# m -> maintenance script
d() {
if [ "$(grep -Ei 'debian|buntu|mint' /etc/*release)" ]; then
@@ -17,6 +18,18 @@ d() {
fi
}
m() {
d=$(d)
if [ $d == 2 ]; then
./arch-maintenance.sh
elif [ $d == 1 ]; then
./debian-maintenance.sh
else
echo "ERROR - Distro not supported."
return 1
fi
}
p() {
# Detect distro type
if [ "$(grep -Ei 'debian|buntu|mint' /etc/*release)" ]; then