Skip to content

Commit

Permalink
v0.2.1 - fix to packs count when no updates are available
Browse files Browse the repository at this point in the history
  • Loading branch information
tavinus committed Jun 26, 2017
1 parent c59d546 commit e9656a1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions opkg-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


### Initialization
OPKGUPVERSION="0.2.0"
OPKGUPVERSION="0.2.1"
OPKGBIN="$(which opkg 2>/dev/null)"
SSMTPBIN="$(which ssmtp 2>/dev/null)"
BANNERSTRING="Simple OPKG Updater v$OPKGUPVERSION"
Expand Down Expand Up @@ -46,7 +46,7 @@ OPKGUP_LOCATION="$(readlink -f $0)"
### Execution vars, populated later
PACKS=""
PACKS_NAMES=""
PACKS_COUNT=""
PACKS_COUNT=0



Expand Down Expand Up @@ -293,11 +293,14 @@ opkg_upgradable() {
PACKS="$($OPKGBIN list-upgradable)"
[ $? -eq 0 ] || rt_exception $'Error when trying list upgradable packages. Permissions?\n'
#PACKS="$(cat pkg-example.txt)" # testing
PACKS_NAMES="$(echo -ne "$PACKS" | awk '{ printf "%s ", $1 }')"
#echo -ne "$PACKS" | awk '{ printf "pack: %s from: %s to: %s \n", $1, $3, $5 }'
PACKS_COUNT="$(echo "$PACKS" | wc -l)"
if ! is_empty "$PACKS"; then
PACKS_NAMES="$(echo -ne "$PACKS" | awk '{ printf "%s ", $1 }')"
#echo -ne "$PACKS" | awk '{ printf "pack: %s from: %s to: %s \n", $1, $3, $5 }'
PACKS_COUNT="$(echo "$PACKS" | wc -l)"
fi
message_ends
is_quiet || echo ""
return $TRUE
}


Expand Down

0 comments on commit e9656a1

Please sign in to comment.