Hi Ryuno-Ki,
your script shows "Packages to remove". See below:
Before upgrade:
- Code: Select all
$ equo query updates
>> @@ Available Updates
>> Packages to update: 39
>> Packages to remove: 42
$ packageupdate.sh
42 packages needed to be updated!
After upgrade:
- Code: Select all
$equo query updates
>> @@ Available Updates
>> Packages to update: 0
>> Packages to remove: 43
$ packageupdate.sh
43 packages needed to be updated!
You actually need to get the second line line of the equo query output: "Packages to update".
Edit: So I altered the script a little bit
- Code: Select all
#!/bin/bash
UP="$(equo query updates | awk 'NR==2 {print $5}')"
echo "$UP" packages needed to be updated!
...but you don't need to do anything like that, it's enough to run
equo query with the
-q argument for quiet output:
- Code: Select all
equo query updates -q
0