See the Security and Bug Fixes Section - Grub EFI Install Updates Fix Sticky


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GUI Updates script
#21
(11-25-2014, 02:25 AM)Jerry link Wrote: I think I prefer the existing method of handling the gdebi/synaptic check, it's simpler and quicker.
I thought it would be nice to have an opportunity to stop the kill switch. Smile
Whatever you think it's best.
It's definitelly quicker. Smile
(11-25-2014, 02:25 AM)Jerry link Wrote: Also running your new code I still get the 'List of available Updates - Click OK to continue or Cancel to stop the update process' existing dialog, not your new one, but this time it's empty when there are lots of updates for my machine:
Arrrgh. Sad
Why can't 'zenity --text-info' tell when you use the wrong filename.
I've entered
--filename="/tmp/updateslist "
instead of
--filename="/tmp/updateslist"
No error messages at all...
It took me some time to figure it out.

I've swithed back to the existing method of handling the gdebi/synaptic check.
Code:
#!/bin/bash
#-----------------------------------------------------------------------------------------
# Name: Linux Lite Updates
# Description: A GUI tool to easily install Updates in Linux Lite.
# Authors: Misko_2083, Jerry Bezencon
# Date: Nov 20th, 2014
# Website: https://www.linuxliteos.com
#-----------------------------------------------------------------------------------------

# Kill off any package managers that may be running
if [ "$(pidof synaptic)" ]
then
   sudo killall -9 synaptic
else
   echo""
fi
if [ -z "$(pgrep gdebi-gtk)" ]
then
   echo ""
else
   killall -9 gdebi-gtk
fi

# Linux Lite default dialog icon
ic="/usr/share/icons/zenity-llcc.png"

# Get list of available updated packages then populate them to /tmp/updateslist
zenity --question --title="Linux Lite Updates" --window-icon="/usr/share/icons/zenity-llcc.png" --text="We will now fetch the Updates list.\n\nClick Yes to continue or No to abort."
   if [ "$?" -eq "0" ];then

x=$( stdbuf -oL /bin/bash \-c '(sudo apt-get update \-y )' 2>&1 |
stdbuf -oL sed -n -e '/\[*$/ s/^/# /p' -e '/\*$/ s/^/# /p'|
zenity --progress --title="Updating package information..." --pulsate \
--width=600 --auto-close )


# Creates a list in /tmp/updateslist
LISTNAMES=$(apt-get --just-print upgrade 2>&1 | perl -ne 'if (/Inst\s([\w,\-,\d,\.,~,:,\+]+)\s\[([\w,\-,\d,\.,~,:,\+]+)\]\s\(([\w,\-,\d,\.,~,:,\+]+)\)? /i) {print "Name: $1 INSTALLED: $2 AVAILABLE: $3\n"}' | tee /tmp/updateslist)


# A check here to see if any updates are available, if there are none, script pops up dialog box saying 'No Updates Available', removes /tmp/updateslist
if [  -z "$(cat /tmp/updateslist)"  ]; then
     zenity --info --window-icon="/usr/share/icons/zenity-llcc.png" --title="Linux Lite Updates" \
        --text="No Updates Available"
    rm /tmp/updateslist
    exit 0
fi

#Insert text into  /tmp/updateslist
sed -i -e '1 i\#########                     List of available Updates                                           ##############' -e '1 i\#########  Click OK to continue or Cancel to stop the update process         ##############' /tmp/updateslist

# Erase existing available info
sudo dpkg --clear-avail



  else
       exit 0
  fi

# Call the zenity dialog to show update list
zenity --text-info --title="List of available Updates - Click OK to continue or Cancel to stop the update process" --width=700 --height=300 --filename="/tmp/updateslist"
   if [ "$?" -eq "0" ];then

# Main window dialogue.
INSTALLER_TITLE="Linux Lite Updates
-----------------------------------------------------------------------------------------------------------

Please make sure all software installation programs like
<b>Synaptic Package Manager</b> and <b>Gdebi</b> are closed before proceeding.

When you click on <b>Yes</b>, this window will close and the updates will begin.

-----------------------------------------------------------------------------------------------------------
Click on <b>Yes</b> to continue or <b>No</b> to cancel the updates process."

# Halt updates script if user selects Cancel
else
    rm /tmp/updateslist
       exit 0
fi

# Continue script if no halt
INSTALL_ICON="/usr/share/icons/zenity-llcc.png"
APPNAME="Linux Lite"
       
        zenity --question --title="$APPNAME Updates" --window-icon="${INSTALL_ICON}" --text="${INSTALLER_TITLE}"

                if [ "$?" -eq "0" ]; then

x=$( stdbuf -oL /bin/bash \-c '(sudo apt-get upgrade \-y )' 2>&1 | tee /var/log/llupdates.log |
stdbuf -oL sed -n -e '/\[*$/ s/^/# /p' -e '/\*$/ s/^/# /p'|
zenity --progress --title="Updating..." --pulsate \
--width=600 --auto-close )

                                if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                       
                                        zenity --error \
                                        --title="Error" --text="$APPNAME Updates have failed."
                                        exit 0
                                fi

                else

                                        exit 0
                fi

PROCEED=$(zenity --question --title="$APPNAME Updates" --window-icon=/usr/share/icons/zenity-llcc.png --text="Updates have finished installing.\n\nWould you like to view the $APPNAME Updates log?"; echo $?)
if [ ${PROCEED} -eq 1 ]; then
   zenity --info --title="$APPNAME Updates" --window-icon="${INSTALL_ICON}" --text="$APPNAME Updates Complete."
   exit;
else
   zenity --text-info --title="Updates Log" --width=700 --height=300 --filename="/var/log/llupdates.log"
fi

exit 0
[Image: tWMkzi8.png]
Reply


Messages In This Thread
GUI Updates script - by Valtam - 11-20-2014, 10:36 AM
Re: GUI Updates script - by Valtam - 11-20-2014, 01:09 PM
Re: GUI Updates script - by jabbott - 11-20-2014, 01:44 PM
Re: GUI Updates script - by Scott(0) - 11-20-2014, 02:49 PM
Re: GUI Updates script - by Scott(0) - 11-20-2014, 03:23 PM
Re: GUI Updates script - by Scott(0) - 11-20-2014, 08:35 PM
Re: GUI Updates script - by Valtam - 11-20-2014, 09:58 PM
Re: GUI Updates script - by misko_2083 - 11-20-2014, 10:04 PM
Re: GUI Updates script - by Valtam - 11-20-2014, 10:16 PM
Re: GUI Updates script - by Scott(0) - 11-20-2014, 10:29 PM
Re: GUI Updates script - by misko_2083 - 11-20-2014, 10:33 PM
Re: GUI Updates script - by Valtam - 11-20-2014, 10:42 PM
Re: GUI Updates script - by Valtam - 11-20-2014, 10:48 PM
Re: GUI Updates script - by misko_2083 - 11-21-2014, 10:28 PM
Re: GUI Updates script - by iwar - 11-22-2014, 12:38 AM
Re: GUI Updates script - by Valtam - 11-22-2014, 06:36 AM
Re: GUI Updates script - by Valtam - 11-22-2014, 06:39 AM
Re: GUI Updates script - by Valtam - 11-24-2014, 07:12 AM
Re: GUI Updates script - by misko_2083 - 11-24-2014, 05:14 PM
Re: GUI Updates script - by Valtam - 11-25-2014, 02:25 AM
Re: GUI Updates script - by misko_2083 - 11-25-2014, 03:53 AM
Re: GUI Updates script - by Valtam - 11-25-2014, 04:40 AM
Re: GUI Updates script - by misko_2083 - 11-25-2014, 08:28 AM
Re: GUI Updates script - by Valtam - 11-25-2014, 09:54 AM
Re: GUI Updates script - by misko_2083 - 11-25-2014, 10:54 AM
Re: GUI Updates script - by Valtam - 11-25-2014, 11:19 AM
Re: GUI Updates script - by misko_2083 - 11-25-2014, 08:27 PM
Re: GUI Updates script - by Valtam - 11-25-2014, 10:13 PM
Re: GUI Updates script - by Valtam - 12-01-2014, 02:10 AM
Re: GUI Updates script - by misko_2083 - 12-02-2014, 04:32 PM
Re: GUI Updates script - by Wirezfree - 12-02-2014, 05:18 PM
Re: GUI Updates script - by Valtam - 12-02-2014, 11:23 PM
Re: GUI Updates script - by mlsmith - 12-02-2014, 11:33 PM
Re: GUI Updates script - by misko_2083 - 12-03-2014, 01:28 AM
Re: GUI Updates script - by altman - 12-06-2014, 02:28 AM
Re: GUI Updates script - by Scott(0) - 12-06-2014, 02:36 AM
Re: GUI Updates script - by altman - 12-06-2014, 02:40 AM
Re: GUI Updates script - by Scott(0) - 12-06-2014, 02:46 AM
Re: GUI Updates script - by altman - 12-06-2014, 02:48 AM
Re: GUI Updates script - by Valtam - 12-06-2014, 09:23 AM
Re: GUI Updates script - by Wirezfree - 12-06-2014, 12:23 PM
Re: GUI Updates script - by Valtam - 12-06-2014, 12:28 PM
Re: GUI Updates script - by Wirezfree - 12-06-2014, 01:03 PM
Re: GUI Updates script - by misko_2083 - 02-20-2015, 03:17 AM
Re: GUI Updates script - by misko_2083 - 02-20-2015, 03:44 AM
Re: GUI Updates script - by Valtam - 02-20-2015, 06:37 AM
Re: GUI Updates script - by misko_2083 - 02-20-2015, 08:02 AM
Re: GUI Updates script - by Valtam - 02-20-2015, 09:27 AM
Re: GUI Updates script - by misko_2083 - 02-20-2015, 09:37 AM
Re: GUI Updates script - by Valtam - 02-20-2015, 10:09 AM
Re: GUI Updates script - by misko_2083 - 02-20-2015, 10:33 AM
Re: GUI Updates script - by Valtam - 02-21-2015, 04:28 AM
Re: GUI Updates script - by Valtam - 02-21-2015, 05:54 AM

Forum Jump:


Users browsing this thread: 25 Guest(s)