mirror of
https://github.com/G2-Games/welcome.sh.git
synced 2025-04-19 05:22:53 -05:00
Added support for OpenSUSE update checks with Zypper
This commit is contained in:
parent
f78aed8316
commit
e82a0cf000
1 changed files with 10 additions and 4 deletions
12
welcome.sh
12
welcome.sh
|
@ -119,12 +119,12 @@ updates () {
|
||||||
|
|
||||||
# Check for updates from different places... wonder if there's a better way
|
# Check for updates from different places... wonder if there's a better way
|
||||||
updchk () {
|
updchk () {
|
||||||
# Check for APT
|
# Check for APT (Debian based)
|
||||||
if command -v apt-get &> /dev/null; then
|
if command -v apt-get &> /dev/null; then
|
||||||
debian=$(apt-get -s dist-upgrade -V | grep -c '=>')
|
debian=$(apt-get -s dist-upgrade -V | grep -c '=>')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for different Arch things
|
# Check for Arch things
|
||||||
if command -v checkupdates &> /dev/null; then
|
if command -v checkupdates &> /dev/null; then
|
||||||
arch=$(checkupdates 2> /dev/null | wc -l)
|
arch=$(checkupdates 2> /dev/null | wc -l)
|
||||||
elif command -v yay &> /dev/null; then
|
elif command -v yay &> /dev/null; then
|
||||||
|
@ -144,6 +144,12 @@ updates () {
|
||||||
fedora=$((fedora-1))
|
fedora=$((fedora-1))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check for OpenSUSE things
|
||||||
|
if command -v zypper &> /dev/null; then
|
||||||
|
suse=$(zypper list-updates 2> /dev/null | wc -l)
|
||||||
|
suse=$((suse-4))
|
||||||
|
fi
|
||||||
|
|
||||||
# Check for Brew updates
|
# Check for Brew updates
|
||||||
if command -v brew &> /dev/null; then
|
if command -v brew &> /dev/null; then
|
||||||
brew=$(brew outdated 2> /dev/null | wc -l)
|
brew=$(brew outdated 2> /dev/null | wc -l)
|
||||||
|
@ -155,7 +161,7 @@ updates () {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add all update counts together
|
# Add all update counts together
|
||||||
updates=$((debian + arch + fedora + flatpak + brew))
|
updates=$((debian + arch + fedora + suse + flatpak + brew))
|
||||||
echo $updates >| ~/.welcome/updates
|
echo $updates >| ~/.welcome/updates
|
||||||
pkill -P "${pid}" sleep # When update checking is finished, kill the sleep function running under this bash process
|
pkill -P "${pid}" sleep # When update checking is finished, kill the sleep function running under this bash process
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
Loading…
Reference in a new issue