Skip to content
This repository has been archived by the owner on May 22, 2019. It is now read-only.

Commit

Permalink
fix issue where checking for updates notification isnt automatically …
Browse files Browse the repository at this point in the history
…cleared after updates check has completed
  • Loading branch information
lots0logs committed Jun 19, 2016
1 parent 143c863 commit 6855cae
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
30 changes: 22 additions & 8 deletions dist/antergos-iso
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,33 @@ fi
###

pac() {
local exit_status

sudo pacman "$1" --noconfirm --force --needed "${@:2}"
exit_status="$?"

_2log "pac() ran with args: $*. Exit status was: ${exit_status}"

return "${exit_status}"
}


packey() {
local exit_status

sudo pacman-key "$@"
exit_status="$?"

_2log "packey() ran with args: $*. Exit status was: ${exit_status}"

return "${exit_status}"
}


hotfix_setup_environment() {
_2log "[antergos-iso] Setting up environment.."
_2log '[antergos-iso] Setting up environment..'

APP_NAME='Cnchi'
LEVEL='critical'
APP_ICON='/usr/share/cnchi/data/images/antergos/antergos-icon.png'

[[ -f /tmp/.setup-running ]] && CNCHI_STARTED='True'
Expand Down Expand Up @@ -117,6 +130,8 @@ add_or_remove_antbs_mirrorlist() {
fi

sudo rm /var/lib/pacman/db.lck > /dev/null 2>&1

return 0
}


Expand All @@ -139,8 +154,9 @@ hotfix_waiting_for_internet() {


hotfix_maybe_update() {
_notify_user "${CHECKING_UPDATES}" "${CHECKING_UPDATES_SUB}"
add_or_remove_antbs_mirrorlist 'add'
pac -Syy iso-hotfix-utility || populate_pacman_keyring && pac -Syy iso-hotfix-utility
pac -Syy iso-hotfix-utility || { populate_pacman_keyring && pac -Syy iso-hotfix-utility; }
}


Expand All @@ -161,14 +177,12 @@ hotfix_run_when_connected() {
local CHECK_UPDATES
CHECK_UPDATES=$(sudo checkupdates)

[[ "${CHECK_UPDATES}" = *'cnchi'* ]] && UPDATE_CNCHI='True'

if [[ ${UPDATE_CNCHI} = 'True' ]]; then
if [[ "${CHECK_UPDATES}" = *'cnchi'* ]]; then
notify_user "${INSTALLING_UPDATES}" "${INSTALLING_UPDATES_SUB}"
stop_cnchi
pac -S cnchi && LEVEL='normal'; _notify_user "${UPDATE_COMPLETE}" "${UPDATE_COMPLETE_SUB}"
pac -S cnchi && { LEVEL='normal' _notify_user "${UPDATE_COMPLETE}" "${UPDATE_COMPLETE_SUB}"; }
else
LEVEL='normal'; notify_no_updates
LEVEL='normal' notify_no_updates
fi

[[ -f /tmp/.setup-running ]] || start_cnchi
Expand Down
6 changes: 3 additions & 3 deletions iso-hotfix-utility
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@
##
###

LEVEL='critical'

if [[ -z "${_INITIALIZED}" ]]; then
NETWORK_ALIVE=1
NOTIFIED='False'
SCRIPT_UPDATED='False'
LAST_SENT=''
APP_ICON=''
APP_NAME=''
LEVEL=''
_INITIALIZED='True'
fi

Expand Down Expand Up @@ -109,11 +110,10 @@ _maybe_update_rerun_and_exit() {
return
fi

_notify_user "${CHECKING_UPDATES}" "${CHECKING_UPDATES_SUB}"
hotfix_maybe_update

if [[ -f /usr/bin/iso-hotfix-utility ]]; then
{ nohup /usr/bin/iso-hotfix-utility & >> "${LOG_PATH}" 2>&1; } && exit 0
{ nohup /usr/bin/iso-hotfix-utility & } && exit 0
else
_2log '[iso-hotfix-utility] Failed to update hotifx package!'
fi
Expand Down

0 comments on commit 6855cae

Please sign in to comment.