You are Here:
Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section



GUI Updates script

Author (Read 31608 times)

0 Members and 2 Guests are viewing this topic.

Re: GUI Updates script
« Reply #38 on: December 05, 2014, 09:46:42 PM »
 

Scott

  • Global Moderator
  • Gold Level Poster
  • *****
  • 857
    Posts
  • Reputation: 186
  • Linux Lite Member
    • View Profile

  • CPU: Dual core Intel Core i3 M 330

  • MEMORY: 6Gb

  • VIDEO CARD: Intel Integrated Graphics
 8) No problem. I confused the two a few times myself.
 

Re: GUI Updates script
« Reply #37 on: December 05, 2014, 09:40:31 PM »
 

altman

  • Gold Level Poster
  • *******
  • 739
    Posts
  • Reputation: 43
  • Linux Lite Member
    • View Profile
Hey cool , tought of a combo between both of these maybe , anyhow , I can do with these . lol , forgot about Lite Cleaner , good call .
HP DV7 i7 2670QM 500.1GB 8GB Ram Dual-Boot LL2.4 Beta / Extix 15.1.1 64-bit 
Dell Inspiron 1720 CrunchBang 11

Duckduckgo ( for now )
 

Re: GUI Updates script
« Reply #36 on: December 05, 2014, 09:36:21 PM »
 

Scott

  • Global Moderator
  • Gold Level Poster
  • *****
  • 857
    Posts
  • Reputation: 186
  • Linux Lite Member
    • View Profile

  • CPU: Dual core Intel Core i3 M 330

  • MEMORY: 6Gb

  • VIDEO CARD: Intel Integrated Graphics
@Altman

I believe that the Lite Cleaner handles those tasks.

~Scott
 

Re: GUI Updates script
« Reply #35 on: December 05, 2014, 09:28:02 PM »
 

altman

  • Gold Level Poster
  • *******
  • 739
    Posts
  • Reputation: 43
  • Linux Lite Member
    • View Profile
Love the scripts . Save some time  .

Dont know where to put it , please post where needed : can someone add sudo apt-get clean ; sudo apt-get autoclean ; sudo apt-get autoremove at the end of this script somehow !

Just an idea in order to cleanup LL . For what it s worth .
HP DV7 i7 2670QM 500.1GB 8GB Ram Dual-Boot LL2.4 Beta / Extix 15.1.1 64-bit 
Dell Inspiron 1720 CrunchBang 11

Duckduckgo ( for now )
 

Re: GUI Updates script
« Reply #34 on: December 02, 2014, 08:28:25 PM »
 

anon222

  • Muted
  • Gold Level Poster
  • *
  • 688
    Posts
  • Reputation: 192
  • Linux Lite Member
    • View Profile

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
Can you please give me an example? (full script code)
Almost forgot.
I've changed line 70 to    x=$( stdbuf -oL /bin/bash \-c '(sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade \-y )' 2>&1 | tee /var/log/llupdates.log |
Example:
Code: [Select]
#!/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"}' | awk '{print NR,":\t"$0}' | tee /tmp/updateslist)

# Check 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 Update to continue or Cancel to stop the update process\n'  /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 --ok-label="Update" --cancel-label="Cancel" --title="Linux Lite Updates" --width=780 --height=300 --filename="/tmp/updateslist"
      if [ "$?" -eq "0" ];then
       

      # Continue script if no halt
        INSTALL_ICON="/usr/share/icons/zenity-llcc.png"
        APPNAME="Linux Lite"
       
                 #remove tmp file
                 rm /tmp/updateslist

x=$( stdbuf -oL /bin/bash \-c '(sudo DEBIAN_FRONTEND=noninteractive 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

  # Halt updates script if user selects Cancel
    else
        rm /tmp/updateslist
         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 --ok-label="Save Updates Log" --cancel-label="Close" --title="Updates Log" --width=700 --height=300 --filename="/var/log/llupdates.log"
if [ $? -ne 0 ]; then
exit;
else

         #Generate the save list and on the first occurance of "FALSE" change it to "TRUE"
         LL_LIST_D=(`awk -F':' '$3>=1000 && $3<=60000 {print "FALSE","/home/"$1}' /etc/passwd |sed '0,/FALSE/s/FALSE/TRUE/'`)
         
#Add optional save location
         LL_LIST_H=(`awk -F':' '$3>=1000 && $3<=60000 {print "FALSE","/home/"$1"/Desktop"}' /etc/passwd`)
         
         save_location=$(zenity --title="System Report Save Location" --list --radiolist --text="Select save location:" --column="Select" --column="Save file location:" --width=325  --height=300 "${LL_LIST_D[@]}" "${LL_LIST_H[@]}")
            if [ $? -ne 0 ]; then
                exit
            else       
                  #Extract username
                  LL_USER=$(echo "$save_location" | cut -d'/' -f3)
                 
                  # Add filename to the save path
                  SAVE_PATH=$(echo $save_location| sed 's,.*,&\/var/log/llupdates.log,g')
                       
#Checks if the file exists. If it does asks for confirmation.
if [  ! -z "$(echo $SAVE_PATH)" ]; then
if zenity --question --title="$APPNAME Updates" --window-icon=/usr/share/icons/zenity-llcc.png --text="file ${SAVE_PATH} allready exists.\nWould you like to overwite the file?"; then
                 
                    cp /var/log/llupdates.log $save_location
else
exit
fi
else                 
   
cp /var/log/llupdates.log $save_location
fi
                         
               
    fi
fi
fi
exit
 

Re: GUI Updates script
« Reply #33 on: December 02, 2014, 06:33:49 PM »
 

Mike

  • Forum Regular
  • ***
  • 212
    Posts
  • Reputation: 26
  • Linux Lite Enthusiast
    • View Profile
Just out of curiosity, what's the benefit of using this script vs. HardInfo?

Edit: Sorry, wrong topic. Please see this one instead: https://www.linuxliteos.com/forums/index.php?topic=1237
« Last Edit: December 02, 2014, 06:37:13 PM by mlsmith »
 

Re: GUI Updates script
« Reply #32 on: December 02, 2014, 06:23:28 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Smart  move Jerry :)
What do yo think about adding the list dialog to copy the log file? Something like the list in the new system report.

Can you please give me an example? (full script code)
 

Re: GUI Updates script
« Reply #31 on: December 02, 2014, 12:18:52 PM »
 

Wirezfree

  • PayPal Supporter
  • Platinum Level Poster
  • *****
  • 1484
    Posts
  • Reputation: 405
  • Linux Lite "Advocate"
    • View Profile

  • CPU: i7-4790S

  • MEMORY: 16Gb

  • VIDEO CARD: Intel HD4600 (Integrated)
Hi Jerry, misko and sysdrum,

I have been following your threads on the GUI Updates & System Reporting Scripts with interest.
I don't know if it's possible.??
Once they are defined "stable", would it be possible to add them into the "How To's..."
How to add:
Update GUI
System Reporting

It would be great for the folks who are either sticking on LL2.0 or not quite ready to make the move.

Just a thought...

Dave
Upgrades WIP 2.6 to 2.8 - (6 X 2.6 to 2.8 completed on: 20/02/16 All O.K )
Linux Lite 3.0 Humming on a ASRock N3070 Mobo ~ btrfs RAID 10 Install on 4 Disks :)

Computers Early days:
ZX Spectrum(1982) , HP-150 MS-DOS(1983) , Amstrad CPC464(1984) ,  BBC Micro B+64(1985) , My First PC HP-Vectra(1987)
 

Re: GUI Updates script
« Reply #30 on: December 02, 2014, 11:32:24 AM »
 

anon222

  • Muted
  • Gold Level Poster
  • *
  • 688
    Posts
  • Reputation: 192
  • Linux Lite Member
    • View Profile

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
Smart  move Jerry :)
What do yo think about adding the list dialog to copy the log file? Something like the list in the new system report.
 

Re: GUI Updates script
« Reply #29 on: November 30, 2014, 09:10:34 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Changed line 70:

Code: [Select]
x=$( stdbuf -oL /bin/bash \-c '(sudo apt-get upgrade \-y )' 2>&1 | tee /var/log/llupdates.log |
to

Code: [Select]
x=$( stdbuf -oL /bin/bash \-c '(sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade \-y )' 2>&1 | tee /var/log/llupdates.log |
to suppress debconf errors, that don't actually mean anything is wrong, but may raise questions about updates errors from people.
 

Re: GUI Updates script
« Reply #28 on: November 25, 2014, 05:13:58 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Excellent :)
 

Re: GUI Updates script
« Reply #27 on: November 25, 2014, 03:27:35 PM »
 

anon222

  • Muted
  • Gold Level Poster
  • *
  • 688
    Posts
  • Reputation: 192
  • Linux Lite Member
    • View Profile

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
I was thinking to remove the zenity question dialog.
There is no need to click on yes after you click on update.
Code: [Select]
#!/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"}' | awk '{print NR,":\t"$0}' | tee /tmp/updateslist)

# Check 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 Update to continue or Cancel to stop the update process\n'  /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 --ok-label="Update" --cancel-label="Cancel" --title="Linux Lite Updates" --width=780 --height=300 --filename="/tmp/updateslist"
      if [ "$?" -eq "0" ];then
       

      # Continue script if no halt
        INSTALL_ICON="/usr/share/icons/zenity-llcc.png"
        APPNAME="Linux Lite"
       
                 #remove tmp file
                 rm /tmp/updateslist

       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

   # Halt updates script if user selects Cancel
    else
         rm /tmp/updateslist
             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 --ok-label="Quit" --cancel-label="Cancel" --title="Updates Log" --width=700 --height=300 --filename="/var/log/llupdates.log"
fi

exit 0
Cheers :)
 

Re: GUI Updates script
« Reply #26 on: November 25, 2014, 06:19:34 AM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
How's this?

Code: [Select]
#!/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"}' | awk '{print NR,":\t"$0}' | tee /tmp/updateslist)

# Check 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 Update to continue or Cancel to stop the update process\n'  /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 --ok-label="Update" --cancel-label="Cancel" --title="Linux Lite Updates" --width=780 --height=300 --filename="/tmp/updateslist"
   if [ "$?" -eq "0" ];then

# 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 --ok-label="Quit" --cancel-label="Cancel" --title="Updates Log" --width=700 --height=300 --filename="/var/log/llupdates.log"
fi

exit 0
 

Re: GUI Updates script
« Reply #25 on: November 25, 2014, 05:54:12 AM »
 

anon222

  • Muted
  • Gold Level Poster
  • *
  • 688
    Posts
  • Reputation: 192
  • Linux Lite Member
    • View Profile

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
Nice touch there Jerry :)
OK should be changed to update
Code: [Select]
zenity --text-info --ok-label="Update" --cancel-label="Drink beer"We could also remove the folowing question

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."
Cheers :)
 

Re: GUI Updates script
« Reply #24 on: November 25, 2014, 04:54:56 AM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Nice additions there misko :) I have changed some of the text and code to have us finish up with this:

Code: [Select]
#!/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"}' | awk '{print NR,":\t"$0}' | tee /tmp/updateslist)

# Check 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\n'  /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="Linux Lite Updates" --width=780 --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


« Last Edit: November 25, 2014, 05:55:24 AM by Jerry »
 

 

-->
X Close Ad

Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section