2019-01-10 10:45:52 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2019-06-23 15:49:34 +02:00
|
|
|
connect=$(ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` &> /dev/null)
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
updates_arch=$(/usr/bin/checkupdates | wc -l)
|
|
|
|
updates_aur=$(/usr/bin/checkupdates-aur | wc -l)
|
|
|
|
updates=$(("$updates_arch" + "$updates_aur"))
|
|
|
|
if [ "$updates" -gt 0 ]; then
|
2019-11-18 23:09:46 +01:00
|
|
|
echo "%{F#dd7777}%{F#ddd} $updates_arch | $updates_aur"
|
2019-06-23 15:49:34 +02:00
|
|
|
else
|
|
|
|
echo "%{F#77dd77}%{F#ddd} 0"
|
|
|
|
fi
|
2019-01-10 10:45:52 +01:00
|
|
|
else
|
2019-06-23 15:49:34 +02:00
|
|
|
echo "%{F#77dd77}%{F#ddd} Offline"
|
2019-01-10 10:45:52 +01:00
|
|
|
fi
|