diff --git a/gui b/gui index 3f30c92..24d0b8f 100755 --- a/gui +++ b/gui @@ -26,6 +26,10 @@ hidelist="$(cat "${DIRECTORY}/data/hidelist" | sort | uniq | sed '/^[[:space:]]* echo "$hidelist" > "${DIRECTORY}/data/hidelist" ) & +(if cat '/home/pi/.config/autostart/pi-apps-updater.desktop' | grep -q installedonly ;then + "${DIRECTORY}/install" +fi) & + install() { app="$1" #terminal title text diff --git a/install b/install index a7e018e..ceaea67 100755 --- a/install +++ b/install @@ -51,7 +51,7 @@ echo "Creating autostarted updater..." mkdir -p ~/.config/autostart echo "[Desktop Entry] Name=Pi Apps Updater -Exec=${DIRECTORY}/updater installedonly +Exec=${DIRECTORY}/updater onboot Icon=${DIRECTORY}/icons/logo.png Terminal=false Type=Application diff --git a/updater b/updater index 432397c..31049ae 100755 --- a/updater +++ b/updater @@ -38,9 +38,10 @@ else echo "Warning: Unrecognized update interval!" fi -#hidden flag: if $1 is 'installedonly', then check for updates only for those apps that are installed. -installedonly="$1" -if [ "$installedonly" == 'installedonly' ];then +#hidden flag: if $1 is 'onboot', then check for updates only for those apps that are installed. +onboot="$1" +if [ "$onboot" == 'onboot' ] || [ "$onboot" == 'installedonly' ];then + onboot='onboot' nocheck=0 #forcibly check, even if time interval doesn't call for it sleep 1m #wait a minute, this is so the system will have booted all the way for an internet connection fi @@ -56,7 +57,7 @@ fi echo "$(date +%j)" > "${DIRECTORY}/data/last-update-check" #generate app update status info -updatable="$("${DIRECTORY}/manage" check-all $installedonly)" +updatable="$("${DIRECTORY}/manage" check-all)" [ $? -ne 0 ] && error "check-all failed! Full output: $updatable" #shorten to last line