From 5776943e58d2b485e2d5e2203a0933e13272e87c Mon Sep 17 00:00:00 2001 From: tavinus Date: Mon, 26 Jun 2017 00:15:57 -0300 Subject: [PATCH] v0.2.2 - fix to asking to update when no updates are available. --- opkg-upgrade.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/opkg-upgrade.sh b/opkg-upgrade.sh index 89a0139..76d71a2 100755 --- a/opkg-upgrade.sh +++ b/opkg-upgrade.sh @@ -16,7 +16,7 @@ ### Initialization -OPKGUPVERSION="0.2.1" +OPKGUPVERSION="0.2.2" OPKGBIN="$(which opkg 2>/dev/null)" SSMTPBIN="$(which ssmtp 2>/dev/null)" BANNERSTRING="Simple OPKG Updater v$OPKGUPVERSION" @@ -72,9 +72,8 @@ main() { upgrade_check # may exit here local uplist="$(list_upgrades)" - local hasups=$? if should_send_ssmtp || just_print_html; then - if [ $hasups -eq 0 ] || should_always_send || just_print_html; then + if opkg_has_update || should_always_send || just_print_html; then QUIET_MODE=$FALSE local email_data='' if is_html_email; then @@ -90,13 +89,15 @@ main() { echo -e "$email_data" | "$SSMTPBIN" "$SEND_TO" exit $? fi + else + echo "whyyyy" fi exit 0 else echo -e "$uplist" fi just_print && exit 0 - [ $hasups -ne 0 ] && exit 0 + opkg_has_update || { echo ; exit 0 ; } if ! no_confirm; then if ! confirm_upgrade; then @@ -129,7 +130,7 @@ list_upgrades() { echo -e "$PACKS" return $TRUE fi - echo $'\nNo packages to install!\n' + echo $'No packages to install!\n\n' return $FALSE }