improve updater

pull/94/head
Botspot 5 years ago
parent 9f48afc285
commit e436bc16e2

4
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

@ -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

@ -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

Loading…
Cancel
Save