27 lines
588 B
Bash
Raw Normal View History

2025-07-27 10:30:33 +02:00
#!/bin/bash
# Variables
listupdates_file=/tmp/listupdates
listupdates_show=/tmp/listupdates_show
# listupdates file init
if [ ! -f ${listupdates_file} ] ; then
touch ${listupdates_file}
echo "0" > ${listupdates_file}
fi
if [ ! -f ${listupdates_show} ] ; then
touch ${listupdates_show}
echo "0" > ${listupdates_show}
fi
2025-07-27 10:30:33 +02:00
# Check updates on Arch Linux
if [ -f /usr/bin/pacman ] ; then
echo "$(cat ${listupdates_show}) "
2025-07-27 10:30:33 +02:00
# Check updates on Ubuntu/Debian/Devuan
2025-08-04 07:57:14 +02:00
elif [ -f /usr/bin/apt ] ; then
echo "$(cat ${listupdates_show}) "
2025-07-27 10:30:33 +02:00
# Disable for other distros
else
2025-08-08 12:47:45 +02:00
echo "0 "
2025-07-27 10:30:33 +02:00
fi