add official arch linux repo updatecheck to script for updates customModules (#254)
* Update checkUpdates.sh add official repo update check * Update checkUpdates.sh separate pacman, aur and total updates check * Update scripts/checkUpdates.sh Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com> * Update scripts/checkUpdates.sh Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com> --------- Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com>
This commit is contained in:
@@ -1,8 +1,21 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
check_arch_updates() {
|
check_arch_updates() {
|
||||||
result=$(yay -Qum --noconfirm 2>/dev/null | wc -l || echo 0)
|
official_updates=0
|
||||||
echo "$result"
|
aur_updates=0
|
||||||
|
|
||||||
|
if [ "$1" = "-y" ]; then
|
||||||
|
aur_updates=$(yay -Qum 2>/dev/null | wc -l)
|
||||||
|
elif [ "$1" = "-p" ]; then
|
||||||
|
official_updates=$(checkupdates 2>/dev/null | wc -l)
|
||||||
|
else
|
||||||
|
official_updates=$(checkupdates 2>/dev/null | wc -l)
|
||||||
|
aur_updates=$(yay -Qum 2>/dev/null | wc -l)
|
||||||
|
fi
|
||||||
|
|
||||||
|
total_updates=$((official_updates + aur_updates))
|
||||||
|
|
||||||
|
echo $total_updates
|
||||||
}
|
}
|
||||||
|
|
||||||
check_ubuntu_updates() {
|
check_ubuntu_updates() {
|
||||||
@@ -17,7 +30,7 @@ check_fedora_updates() {
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-arch)
|
-arch)
|
||||||
check_arch_updates
|
check_arch_updates "$2"
|
||||||
;;
|
;;
|
||||||
-ubuntu)
|
-ubuntu)
|
||||||
check_ubuntu_updates
|
check_ubuntu_updates
|
||||||
|
|||||||
Reference in New Issue
Block a user