21 lines
308 B
Bash
Executable File
21 lines
308 B
Bash
Executable File
#!/bin/bash
|
|
|
|
upd() {
|
|
checkupdates | wc -l > /tmp/checkupdates
|
|
}
|
|
|
|
if [[ ! -f /tmp/checkupdates ]]; then
|
|
upd
|
|
fi
|
|
|
|
count=$(cat /tmp/checkupdates)
|
|
status="$count updates"
|
|
if [[ $count -eq 0 ]]; then
|
|
status="Up to date"
|
|
elif [[ $count == "1" ]]; then
|
|
status="$count update"
|
|
fi
|
|
echo "$status"
|
|
|
|
upd & disown
|