Linux Lite 8.0 RC1 has been released - Click here


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Lite Upgrade Development
#11

Just an update on what I'm working on, all web services have been restored except for our Bug Tracker. I'm on the lookout for a new one that is easy for newbies to use. I'm giving myself this week to finish it, then the next priority is to work with you on the upgrade script. Any luck testing it on 2.0?

Download your free copy of Linux Lite today.

Jerry Bezencon
Linux Lite Creator

"Do not correct a fool, or he will hate you; correct a wise man and he will appreciate you."

[Image: X5qGkCg.png]

[Image: 0op1GNe.png] [Image: LgJ2mtP.png] [Image: vLZcFUE.png] [Image: lrUHro3.jpg]
Reply
#12

I've tested and it worked.
Got some errors when the script was trying to copy some .desktop files.
Will have to look into this.
Reply
#13

Thank you.

Download your free copy of Linux Lite today.

Jerry Bezencon
Linux Lite Creator

"Do not correct a fool, or he will hate you; correct a wise man and he will appreciate you."

[Image: X5qGkCg.png]

[Image: 0op1GNe.png] [Image: LgJ2mtP.png] [Image: vLZcFUE.png] [Image: lrUHro3.jpg]
Reply
#14

Just tested your code on a fresh install of 2.2, worked nice, great stuff misko :)


Download your free copy of Linux Lite today.

Jerry Bezencon
Linux Lite Creator

"Do not correct a fool, or he will hate you; correct a wise man and he will appreciate you."

[Image: X5qGkCg.png]

[Image: 0op1GNe.png] [Image: LgJ2mtP.png] [Image: vLZcFUE.png] [Image: lrUHro3.jpg]
Reply
#15

(03-19-2015, 03:23 AM)Jerry link Wrote:  Just tested your code on a fresh install of 2.2, worked nice, great stuff misko :)
Thanks Jerry.
Just tested on a fresh install of 2.0 32bit
Code:
linuxlite@linuxlite-virtual-machine:~$ lite-upgrade-series2
cp: cannot stat '/etc/skel/.config/lxterminal/lxterminal.conf': No such file or directory
cp: cannot create regular file '/etc/skel/.llupgradebackup/2.4/whiskermenu-1.rc': Permission denied
cp: cannot create regular file '/etc/skel/.llupgradebackup/2.4/exo-terminal-emulator.desktop': Permission denied
cp: cannot stat '/etc/skel/.local/share/applications/exo-file-manager.desktop': No such file or directory
cp: cannot create regular file '/etc/skel/.llupgradebackup/2.4/xfce4-keyboard-shortcuts.xml': Permission denied
cp: cannot stat '/etc/skel/.local/share/applications/exo-file-manager.desktop': No such file or directory
cp: cannot create regular file '/etc/skel/.llupgradebackup/2.4/alacarte-made-2.desktop': Permission denied
cp: cannot create regular file '/etc/skel/.llupgradebackup/2.4/alacarte-made-4.desktop': Permission denied
cp: cannot create regular file '/etc/skel/.llupgradebackup/2.4/alacarte-made-5.desktop': Permission denied
cp: cannot create regular file '/etc/skel/.llupgradebackup/2.4/alacarte-made-6.desktop': Permission denied
cp: cannot create regular file '/etc/skel/.llupgradebackup/2.4/alacarte-made-7.desktop': Permission denied
cp: cannot stat '/etc/skel/.local/share/applications/alacarte-made-10.desktop': No such file or directory
cp: cannot stat '/etc/skel/.local/share/applications/alacarte-made-11.desktop': No such file or directory
cp: cannot create regular file '/etc/skel/.llupgradebackup/2.4/uca.xml': Permission denied
mv: cannot stat '/etc/skel/.local/share/applications/exo-file-manager.desktop': No such file or directory
mv: cannot stat '/etc/skel/.local/share/applications/alacarte-made-10.desktop': No such file or directory
mv: cannot stat '/etc/skel/.local/share/applications/alacarte-made-11.desktop': No such file or directory
mv: cannot stat '/etc/skel/.config/lxterminal/lxterminal.conf': No such file or directory
No permisions on /etc/skel
Code:
ls -l /etc
drwxr-xr-x 23 linuxlite root       4096 мар 19 23:11 skel
Maybe I should move the /etc/skel backup part in lite-upgrade-system-series2 because of permissions.
Reply
#16

Made many changes. Tested on 32bit 2.0 and 2.2. Working.
lite-upgrade-series2
Code:
#!/bin/bash
#----------------------------------------------------------------
# Description: Linux Lite Upgrade Script - Home
# About: For Linux Lite 2.- Series only
# Authors: Misko_2083, Jerry Bezencon 2015
# Website: https://www.linuxliteos.com
#----------------------------------------------------------------

# Ensure multi-language support
export LANG=C

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

# Set functions for non-root execution
# The ones that need root go to the other file: lite-upgrade-system-series2
MKDIRBUPS() {
    echo "#Creating back up directories..."
    sleep 2
        mkdir -p /home/$USER/.llupgradebackup/2.4
            if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                        echo "#Error"
                    sleep 2
                                        zenity --error \
                                        --title="Error" --text="There was an error while\nCreating back up directories!\nUpgrade canceled."
                    exit 1
                        fi
     mkdir -p /etc/skel/.llupgradebackup/2.4
            if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                        echo "#Error"
                    sleep 2
                                        zenity --error \
                                        --title="Error" --text="There was an error while\nCreating back up directories!\nUpgrade canceled."
                    exit 1
                        fi
}

# Copy all original files from /home/user and /etc/skel to their respective backup folders and versions

# Backup /home/$USER/ first
BUPHOMEUSER() {
    echo "#Backing up select home files..."
        cp /home/$USER/.config/lxterminal/lxterminal.conf /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.config/xfce4/panel/whiskermenu-1.rc /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.local/share/applications/exo-terminal-emulator.desktop /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.local/share/applications/exo-file-manager.desktop /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.local/share/applications/exo-file-manager.desktop /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.local/share/applications/alacarte-made-2.desktop /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.local/share/applications/alacarte-made-4.desktop /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.local/share/applications/alacarte-made-5.desktop /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.local/share/applications/alacarte-made-6.desktop /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.local/share/applications/alacarte-made-7.desktop /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.local/share/applications/alacarte-made-10.desktop /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.local/share/applications/alacarte-made-11.desktop /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.config/Thunar/uca.xml /home/$USER/.llupgradebackup/2.4
        sleep 2
            if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                        echo "#Error"
                    sleep 2
                                        zenity --error \
                                        --title="Error" --text="There was an error while\nBacking up select home files!"
                        fi
}

BUPHOMEUSER64() {
    echo "#Backing up select home files..."
        cp /home/$USER/.config/lxterminal/lxterminal.conf /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.config/xfce4/panel/whiskermenu-1.rc /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.local/share/applications/exo-terminal-emulator.desktop /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.local/share/applications/exo-file-manager.desktop /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.local/share/applications/exo-file-manager.desktop /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.local/share/applications/alacarte-made-2.desktop /home/$USER/.llupgradebackup/2.4
        cp /home/$USER/.config/Thunar/uca.xml /home/$USER/.llupgradebackup/2.4
        sleep 2
            if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                        echo "#Error"
                    sleep 2
                                        zenity --error \
                                        --title="Error" --text="There was an error while\nBacking up select home files!"
            fi
}

# Set lite-welcome to autostart on first boot
# Executes at the end because the package lite-welcome needs to be installed first
LITEWELCOME() {
UPDATER=$( ln -s /usr/share/applications/lite_welcome.desktop /home/$USER/.config/autostart && sleep 2 |
zenity --progress --percentage=20  --title="Setting Lite Welcome to autostart..." \
--width=600 --auto-close)
            if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                        echo "#Error"
                    sleep 2
                                        zenity --error \
                                        --title="Error" --text="There was an error while\nSeting lite-welcome to autostart on first boot!"
             fi
unset UPDATER
}


# Change launchers from xdg-open to exo-open - to do (path is /home/$USER/.local/share/applications/)
# In 32bit version, file are: exo-terminal-emulator.desktop, alacarte-made-2.desktop, alacarte-made-4.desktop, alacarte-made-5.desktop, alacarte-made-6.desktop
# In 64bit version, file are: exo-terminal-emulator.desktop, Thunar.desktop, alacarte-made-2.desktop
XDGTOEXO() {
    echo "#Changing launchers from xdg-open to exo-open..."
        sed -i "s/Exec=xdg-open/Exec=exo-open/g" /home/$USER/.local/share/applications/exo-terminal-emulator.desktop
        sed -i "s/Exec=xdg-open/Exec=exo-open/g" /home/$USER/.local/share/applications/alacarte-made-2.desktop
        sed -i "s/Exec=xdg-open/Exec=exo-open/g" /home/$USER/.local/share/applications/alacarte-made-4.desktop
        sed -i "s/Exec=xdg-open/Exec=exo-open/g" /home/$USER/.local/share/applications/alacarte-made-5.desktop
        sed -i "s/Exec=xdg-open/Exec=exo-open/g" /home/$USER/.local/share/applications/alacarte-made-6.desktop
        cp /home/$USER/.local/share/applications/exo-terminal-emulator.desktop /etc/skel/.local/share/applications/
        cp /home/$USER/.local/share/applications/alacarte-made-2.desktop /etc/skel/.local/share/applications/
        cp /home/$USER/.local/share/applications/alacarte-made-4.desktop /etc/skel/.local/share/applications/
        cp /home/$USER/.local/share/applications/alacarte-made-5.desktop /etc/skel/.local/share/applications/
        cp /home/$USER/.local/share/applications/alacarte-made-6.desktop /etc/skel/.local/share/applications/
        sleep 2
            if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                        echo "#Error"
                    sleep 2
                                        zenity --error \
                                        --title="Error" --text="There was an error while\nChanging launchers from xdg-open to exo-open!"
                        fi
}

XDGTOEXO64() {
    echo "#Changing launchers from xdg-open to exo-open..."
        sed -i "s/Exec=xdg-open/Exec=exo-open/g" /home/$USER/.local/share/applications/exo-terminal-emulator.desktop
        sed -i "s/Exec=xdg-open/Exec=exo-open/g" /home/$USER/.local/share/applications/alacarte-made-2.desktop
        cp /home/$USER/.local/share/applications/exo-terminal-emulator.desktop /etc/skel/.local/share/applications/
        cp /home/$USER/.local/share/applications/alacarte-made-2.desktop /etc/skel/.local/share/applications/
        sleep 2
            if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                        echo "#Error"
                    sleep 2
                                        zenity --error \
                                        --title="Error" --text="There was an error while\nChanging launchers from xdg-open to exo-open!"
                        fi
}

# Change to gksudo for Install Updates, file is: exo-file-manager.desktop for new GUI Updates
UPDATECOM() {
    echo "#Updating to new GUI Updates..."
        mv /home/$USER/.local/share/applications/exo-file-manager.desktop /home/$USER/.local/share/applications/exo-file-manager.desktop.backup
        mv /etc/skel/.local/share/applications/exo-file-manager.desktop /etc/skel/.local/share/applications/exo-file-manager.desktop.backup
        touch /home/$USER/.local/share/applications/exo-file-manager.desktop
        echo "[Desktop Entry]" >> /home/$USER/.local/share/applications/exo-file-manager.desktop
        echo "Version=1.0" >> /home/$USER/.local/share/applications/exo-file-manager.desktop
        echo "Type=Application" >> /home/$USER/.local/share/applications/exo-file-manager.desktop
        echo "Exec=gksudo /usr/scripts/updates-gui" >> /home/$USER/.local/share/applications/exo-file-manager.desktop
        echo "Icon=system-software-installer" >> /home/$USER/.local/share/applications/exo-file-manager.desktop
        echo "StartupNotify=true" >> /home/$USER/.local/share/applications/exo-file-manager.desktop
        echo "Terminal=false" >> /home/$USER/.local/share/applications/exo-file-manager.desktop
        echo "Categories=Utility;X-XFCE;X-Xfce-Toplevel;" >> /home/$USER/.local/share/applications/exo-file-manager.desktop
        echo "OnlyShowIn=XFCE;" >> /home/$USER/.local/share/applications/exo-file-manager.desktop
        echo "X-XFCE-MimeType=x-scheme-handler/file;x-scheme-handler/trash;" >> /home/$USER/.local/share/applications/exo-file-manager.desktop
        echo "Name=Install Updates" >> /home/$USER/.local/share/applications/exo-file-manager.desktop
        echo "Comment=Get the latest updates for your computer" >> /home/$USER/.local/share/applications/exo-file-manager.desktop
        cp /home/$USER/.local/share/applications/exo-file-manager.desktop /etc/skel/.local/share/applications/
        sleep 2
            if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                        echo "#Error"
                    sleep 2
                                        zenity --error \
                                        --title="Error" --text="There was an error while\nChanging launcher to GUI Updates!"
                        fi
}

# Create new Network Share Settings Menu link, file name will be: alacarte-made-50.desktop
CNSSGUI() {
    echo "#Updating to new GUI Network link..."
        mv /home/$USER/.local/share/applications/alacarte-made-10.desktop /home/$USER/.local/share/applications/alacarte-made-10.desktop.backup
        mv /home/$USER/.local/share/applications/alacarte-made-11.desktop /home/$USER/.local/share/applications/alacarte-made-11.desktop.backup
        mv /etc/skel/.local/share/applications/alacarte-made-10.desktop /etc/skel/.local/share/applications/alacarte-made-10.desktop.backup
        mv /etc/skel/.local/share/applications/alacarte-made-11.desktop /etc/skel/.local/share/applications/alacarte-made-11.desktop.backup
        touch /home/$USER/.local/share/applications/alacarte-made-50.desktop
        echo "[Desktop Entry]" >> /home/$USER/.local/share/applications/alacarte-made-50.desktop
        echo "Comment=Set your Network Share Settings" >> /home/$USER/.local/share/applications/alacarte-made-50.desktop
        echo "Terminal=false" >> /home/$USER/.local/share/applications/alacarte-made-50.desktop
        echo "Name=Network Share Settings" >> /home/$USER/.local/share/applications/alacarte-made-50.desktop
        echo "Exec=gksudo /usr/scripts/cnss-gui" >> /home/$USER/.local/share/applications/alacarte-made-50.desktop
        echo "Type=Application" >> /home/$USER/.local/share/applications/alacarte-made-50.desktop
        echo "Icon=network-workgroup" >> /home/$USER/.local/share/applications/alacarte-made-50.desktop
        echo "Categories=XFCE;GTK;System;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;" >> /home/$USER/.local/share/applications/alacarte-made-50.desktop
        cp /home/$USER/.local/share/applications/alacarte-made-50.desktop /etc/skel/.local/share/applications/
        sleep 2
            if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                        echo "#Error"
                    sleep 2
                                        zenity --error \
                                        --title="Error" --text="There was an error while\nChanging launcher to CNSS GUI!"
                        fi
}

CNSSGUI64() {
    echo "#Updating to new GUI Network link..."
        mv /home/$USER/.local/share/applications/alacarte-made-4.desktop /home/$USER/.local/share/applications/alacarte-made-4.desktop.backup
        mv /home/$USER/.local/share/applications/alacarte-made-5.desktop /home/$USER/.local/share/applications/alacarte-made-5.desktop.backup
        mv /etc/skel/.local/share/applications/alacarte-made-4.desktop /etc/skel/.local/share/applications/alacarte-made-4.desktop.backup
        mv /etc/skel/.local/share/applications/alacarte-made-5.desktop /etc/skel/.local/share/applications/alacarte-made-5.desktop.backup
        touch /home/$USER/.local/share/applications/alacarte-made-50.desktop
        echo "[Desktop Entry]" >> /home/$USER/.local/share/applications/alacarte-made-50.desktop
        echo "Comment=Set your Network Share Settings" >> /home/$USER/.local/share/applications/alacarte-made-50.desktop
        echo "Terminal=false" >> /home/$USER/.local/share/applications/alacarte-made-50.desktop
        echo "Name=Network Share Settings" >> /home/$USER/.local/share/applications/alacarte-made-50.desktop
        echo "Exec=gksudo /usr/scripts/cnss-gui" >> /home/$USER/.local/share/applications/alacarte-made-50.desktop
        echo "Type=Application" >> /home/$USER/.local/share/applications/alacarte-made-50.desktop
        echo "Icon=network-workgroup" >> /home/$USER/.local/share/applications/alacarte-made-50.desktop
        echo "Categories=XFCE;GTK;System;DesktopSettings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings;" >> /home/$USER/.local/share/applications/alacarte-made-50.desktop
        cp /home/$USER/.local/share/applications/alacarte-made-50.desktop /etc/skel/.local/share/applications/
        sleep 2
            if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                        echo "#Error"
                    sleep 2
                                        zenity --error \
                                        --title="Error" --text="There was an error while\nChanging launcher to CNSS GUI!"
                        fi
}

# Change to new terminal theme, file is: /home/$USER/.config/lxterminal/lxterminal.conf
TERMTHEME() {
    echo "#Updating to new Terminal theme..."
        mv /home/$USER/.config/lxterminal/lxterminal.conf /home/$USER/.config/lxterminal/lxterminal.conf.backup
        mv /etc/skel/.config/lxterminal/lxterminal.conf /etc/skel/.config/lxterminal/lxterminal.conf.backup
        touch /home/$USER/.config/lxterminal/lxterminal.conf
        echo "[general]" >> /home/$USER/.config/lxterminal/lxterminal.conf
        echo "fontname=Monospace 10" >> /home/$USER/.config/lxterminal/lxterminal.conf
        echo "selchars=-A-Za-z0-9,./?%&#:_" >> /home/$USER/.config/lxterminal/lxterminal.conf
        echo "scrollback=100000" >> /home/$USER/.config/lxterminal/lxterminal.conf
        echo "bgcolor=#464646" >> /home/$USER/.config/lxterminal/lxterminal.conf
        echo "bgalpha=65535" >> /home/$USER/.config/lxterminal/lxterminal.conf
        echo "fgcolor=#f0f0f0" >> /home/$USER/.config/lxterminal/lxterminal.conf
        echo "disallowbold=false" >> /home/$USER/.config/lxterminal/lxterminal.conf
        echo "cursorblinks=true" >> /home/$USER/.config/lxterminal/lxterminal.conf
        echo "cursorunderline=false" >> /home/$USER/.config/lxterminal/lxterminal.conf
        echo "audiblebell=false" >> /home/$USER/.config/lxterminal/lxterminal.conf
        echo "tabpos=top" >> /home/$USER/.config/lxterminal/lxterminal.conf
        echo "hidescrollbar=false" >> /home/$USER/.config/lxterminal/lxterminal.conf
        echo "hidemenubar=false" >> /home/$USER/.config/lxterminal/lxterminal.conf
        echo "hideclosebutton=false" >> /home/$USER/.config/lxterminal/lxterminal.conf
        echo "disablef10=true" >> /home/$USER/.config/lxterminal/lxterminal.conf
        echo "disablealt=false" >> /home/$USER/.config/lxterminal/lxterminal.conf
        cp /home/$USER/.config/lxterminal/lxterminal.conf /etc/skel/.config/lxterminal/
        sleep 2
            if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                        echo "#Error"
                    sleep 2
                                        zenity --error \
                                        --title="Error" --text="There was an error while\nChanging the Terminal theme!"
                        fi
}

# Implement new Create System Report changes - to do (path is /home/$USER/.local/share/applications/)
# In 32bit version, file is: alacarte-made-7.desktop
# In 64bit version, file is: alacarte-made-8.desktop
# Change - Exec=x-terminal-emulator --geometry=95x25 -t "Create System Report" -e /usr/scripts/info ##to## Exec=gksudo /usr/scripts/systemreport

CREATESYSREP() {
    echo "#Updating Create System Report entry..."
        mv /home/$USER/.local/share/applications/alacarte-made-7.desktop /home/$USER/.local/share/applications/alacarte-made-7.desktop.backup
        touch /home/$USER/.local/share/applications/alacarte-made-7.desktop
        echo "[Desktop Entry]" >> /home/$USER/.local/share/applications/alacarte-made-7.desktop
        echo "Comment=Create a detailed System Report of your computer" >> /home/$USER/.local/share/applications/alacarte-made-7.desktop
        echo "Terminal=false" >> /home/$USER/.local/share/applications/alacarte-made-7.desktop
        echo "Name=Create System Report" >> /home/$USER/.local/share/applications/alacarte-made-7.desktop
        echo "Exec=gksudo /usr/scripts/systemreport" >> /home/$USER/.local/share/applications/alacarte-made-7.desktop
        echo "Type=Application" >> /home/$USER/.local/share/applications/alacarte-made-7.desktop
        echo "Icon=evolution-tasks" >> /home/$USER/.local/share/applications/alacarte-made-7.desktop
        cp /home/$USER/.local/share/applications/alacarte-made-7.desktop /etc/skel/.local/share/applications/
        sleep 2
            if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                        echo "#Error"
                    sleep 2
                                        zenity --error \
                                        --title="Error" --text="There was an error while\nUpdating Create System Report entry!"
                        fi
}

CREATESYSREP64() {
    echo "#Updating Create System Report entry..."
        mv /home/$USER/.local/share/applications/alacarte-made-8.desktop /home/$USER/.local/share/applications/alacarte-made-8.desktop.backup
        touch /home/$USER/.local/share/applications/alacarte-made-8.desktop
        echo "[Desktop Entry]" >> /home/$USER/.local/share/applications/alacarte-made-8.desktop
        echo "Comment=Create a detailed System Report of your computer" >> /home/$USER/.local/share/applications/alacarte-made-8.desktop
        echo "Terminal=false" >> /home/$USER/.local/share/applications/alacarte-made-8.desktop
        echo "Name=Create System Report" >> /home/$USER/.local/share/applications/alacarte-made-8.desktop
        echo "Exec=gksudo /usr/scripts/systemreport" >> /home/$USER/.local/share/applications/alacarte-made-8.desktop
        echo "Type=Application" >> /home/$USER/.local/share/applications/alacarte-made-8.desktop
        echo "Icon=evolution-tasks" >> /home/$USER/.local/share/applications/alacarte-made-8.desktop
        cp /home/$USER/.local/share/applications/alacarte-made-8.desktop /etc/skel/.local/share/applications/
        sleep 2
            if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                        echo "#Error"
                    sleep 2
                                        zenity --error \
                                        --title="Error" --text="There was an error while\nUpdating Create System Report entry!"
                        fi
}

# Add new right click actions to Thunar - to do (path is /home/$USER/.config/Thunar/uca.xml)
THUNARACTIONS() {
    echo "#Adding custom actions to Thunar..."
        sed -i '$ d' /home/$USER/.config/Thunar/uca.xml
        echo '<action>' >> /home/$USER/.config/Thunar/uca.xml
        echo '    <icon>media-optical</icon>' >> /home/$USER/.config/Thunar/uca.xml
        echo '    <name>Check MD5SUM</name>' >> /home/$USER/.config/Thunar/uca.xml
        echo '    <unique-id>1422219337486382-1</unique-id>' >> /home/$USER/.config/Thunar/uca.xml
        echo '    <command>zenity --info --title="Check MD5 for %n" --text="$(md5sum %f)"</command>' >> /home/$USER/.config/Thunar/uca.xml
        echo '    <description>Checks the MD5SUM of an image file</description>' >> /home/$USER/.config/Thunar/uca.xml
        echo '    <patterns>*.iso;*.ISO;*.img;*.IMG</patterns>' >> /home/$USER/.config/Thunar/uca.xml
        echo '    <audio-files/>' >> /home/$USER/.config/Thunar/uca.xml
        echo '    <image-files/>' >> /home/$USER/.config/Thunar/uca.xml
        echo '    <other-files/>' >> /home/$USER/.config/Thunar/uca.xml
        echo '    <text-files/>' >> /home/$USER/.config/Thunar/uca.xml
        echo '    <video-files/>' >> /home/$USER/.config/Thunar/uca.xml
        echo '</action>' >> /home/$USER/.config/Thunar/uca.xml
        echo '</actions>' >> /home/$USER/.config/Thunar/uca.xml
        cp /home/$USER/.config/Thunar/uca.xml /etc/skel/.config/Thunar/
        thunar -q
        sleep 2
            if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                        echo "#Error"
                    sleep 2
                                        zenity --error \
                                        --title="Error" --text="There was an error while\nAdding custom actions to Thunar!"
                        fi
}

# Whisker Menu open with Windows (Super) key- changes /home/$USER/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
MENUSUPERKEY() {
    echo "#Setting Whisker Menu Super key..."
        sleep 2
        xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/Super_L" --create --type string --set "xfce4-popup-whiskermenu"
            if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                        echo "#Error"
                    sleep 2
                                        zenity --error \
                                        --title="Error" --text="There was an error while\nSetting Whisker Menu Super key!"
                        fi
}

# Whisker Menu - changes /home/$USER/.config/xfce4/panel/whiskermenu-1.rc
WHISKERMENU() {
    echo "#Applying Whisker Menu changes..."
        sleep 2
        sed -i "s/command-lockscreen=xflock4/command-lockscreen=light-locker-command -l/g" /home/$USER/.config/xfce4/panel/whiskermenu-1.rc
        cp /home/$USER/.config/xfce4/panel/whiskermenu-1.rc /etc/skel/.config/xfce4/panel/
            if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                        echo "#Error"
                    sleep 2
                                        zenity --error \
                                        --title="Error" --text="There was an error while\nApplying Whisker Menu changes!"
                        fi
    dbus-send --print-reply --dest=org.xfce.Panel /org/xfce/Panel org.xfce.Panel.Terminate boolean:true
}

# Clean up
CLEANUP() {
    echo "#Cleaning up..."
        sleep 2
        rm -rf /home/$USER/.local/share/applications/xarchiver.desktop
        rm -rf /etc/skel/.local/share/applications/xarchiver.desktop
            if [ "${PIPESTATUS[0]}" -ne "0" ]; then
                        echo "#Error"
                    sleep 2
                                        zenity --error \
                                        --title="Error" --text="There was an error while\nCleaning up!"
                        fi
}

REBOOT() {
# Reboot dialogue
# Credit to xunil: http://bbs.archbang.org/viewtopic.php?id=279
title="Linux Lite Upgrade Complete"
exit_type=`zenity  --width="400" --height="220" --title="$title" --list --radiolist --column="Select" \
    --column="Exit Type" --column="Description" \
    TRUE "Reboot" "Reboot your computer"\
    FALSE "Shutdown" "Shutdown your computer"\
    FALSE "Cancel" "Continue using your computer" `

# User must select a target type (Check if they cancelled)
if [ ! "$exit_type" ]; then
    zenity --error --title="Error" --text="You must make a selection"
    zenity --info --title="Linux Lite Upgrade Utility" --text="Upgrade complete.\n\nDon't forget to restart your computer\nto complete the upgrade."
    exit
fi

# Action to perform by user
if [ "$exit_type" = "Reboot" ]
then

        # Do Reboot here
    dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart

elif [ "$exit_type" = "Shutdown" ]
then
    # Do Shutdown here
    dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop

else

    # Do Cancel here
    zenity --info --title="Linux Lite Upgrade Utility" --text="Upgrade complete.\n\nDon't forget to restart your computer\nto complete the upgrade."
    exit 0
fi
}

LL20() {
# Invoke arrays
ARRAYA=()       # Array for LL 2.0

#Check the arch
arch=$(uname -m)

case "$arch" in
    x86)    arch="x86"  ;;
    i?86)   arch="x86"  ;;
    amd64)  arch="amd64"    ;;
    x86_64) arch="amd64"    ;;
    * ) echo "Your Arch '$arch' -> Its not supported."  ;;
esac

# Populate arrays based on the arch
case "$arch" in
    x86)
    ARRAYA+=('MKDIRBUPS')
    ARRAYA+=('BUPHOMEUSER')
    ARRAYA+=('XDGTOEXO')
    ARRAYA+=('UPDATECOM')
    ARRAYA+=('CNSSGUI')
    ARRAYA+=('TERMTHEME')
    ARRAYA+=('CREATESYSREP')            # LL 2.0 only
    ARRAYA+=('THUNARACTIONS')        # LL 2.0 only
    ARRAYA+=('MENUSUPERKEY')
    ARRAYA+=('WHISKERMENU')
    ARRAYA+=('CLEANUP')
    ;;
    amd64)
    ARRAYA+=('MKDIRBUPS')
    ARRAYA+=('BUPHOMEUSER64')
    ARRAYA+=('XDGTOEXO64')
    ARRAYA+=('UPDATECOM')
    ARRAYA+=('CNSSGUI64')
    ARRAYA+=('TERMTHEME')
    ARRAYA+=('CREATESYSREP64')        # LL 2.0 only
    ARRAYA+=('THUNARACTIONS')        # LL 2.0 only
    ARRAYA+=('MENUSUPERKEY')
    ARRAYA+=('WHISKERMENU')
    ARRAYA+=('CLEANUP')
    ;;
esac
}

LL22() {
# Invoke arrays
ARRAYA=()       # Array for LL 2.2

#Check the arch
arch=$(uname -m)

case "$arch" in
    x86)    arch="x86"  ;;
    i?86)   arch="x86"  ;;
    amd64)  arch="amd64"    ;;
    x86_64) arch="amd64"    ;;
    * ) echo "Your Arch '$arch' -> Its not supported."  ;;
esac

# Populate arrays based on the arch
case "$arch" in
    x86)
    ARRAYA+=('MKDIRBUPS')
    ARRAYA+=('BUPHOMEUSER')
    ARRAYA+=('XDGTOEXO')
    ARRAYA+=('UPDATECOM')
    ARRAYA+=('CNSSGUI')
    ARRAYA+=('TERMTHEME')
    ARRAYA+=('MENUSUPERKEY')
    ARRAYA+=('WHISKERMENU')
    ARRAYA+=('CLEANUP')
    ;;
    amd64)
    ARRAYA+=('MKDIRBUPS')
    ARRAYA+=('BUPHOMEUSER64')
    ARRAYA+=('XDGTOEXO64')
    ARRAYA+=('UPDATECOM')
    ARRAYA+=('CNSSGUI64')
    ARRAYA+=('TERMTHEME')
    ARRAYA+=('MENUSUPERKEY')
    ARRAYA+=('WHISKERMENU')
    ARRAYA+=('CLEANUP')
    ;;
esac
}

RUN() {
# Check if ARRAYA is empty
# If it is skip the execution
if [ ${#ARRAYA[@]} -ne 0 ]; then

    x=0
    for k in "${!ARRAYA[@]}"; do  x=$(( $x + 1 )); done  # Get the total number of selected items in array A

    TOTAL_LINES=$x

    printf '%s \n' "${ARRAYA[@]}"|
    while read  line
        do
            $line     # Execute functions one by one
            if [ $? = 1 ]; then
                zenity --error --title="Lite Upgrade" --text="There was an error while performing upgrades:\n ${line}"
                exit 1
            fi   
        let i++
         (( PERCENTAGE = 100 \* ${i} / ${TOTAL_LINES} ))
         echo "$PERCENTAGE"

        if [ "$PERCENTAGE" == "100" ]; then
            echo "#Done"
            sleep 2
        fi
   
    done| zenity --progress  --title="Lite Upgrade" --auto-kill --auto-close --width=300
fi


    gksudo /usr/bin/lite-upgrade-system-series2 "$USER"      # Run the next script with superuser privileges


LLVER=$(awk '{print $3}' /etc/llver)
if [ "$LLVER" == "2.4" ]; then

    # Set lite-welcome to autostart on first boot
    LITEWELCOME

    # Call the reboot dialogue
    REBOOT

else
    zenity --info --title="Linux Lite Upgrade Utility" --text="Upgrade canceled."
fi
}

# First dialogue box
zenity --question --title="Linux Lite Upgrade Utility" --window-icon="/usr/share/icons/zenity-llcc.png" \
--text="We will now Upgrade your system to Linux Lite 2.4\n\nPlease ensure you are connected to the internet before you start.\n\nAt the end of this upgrade, please reboot to complete the upgrade process.\n\nClick Yes to continue or No to abort."

# If No is clicked then exit
if [ "${PIPESTATUS[0]}" -ne "0" ]; then
    zenity --info --title='Linux Lite Upgrade Utility' --text='Upgrade cancelled.' --width="250"
      exit 0
fi

#Check the version and start  the appropriate function
LLVER=$(awk '{print $3}' /etc/llver)

if [ "$LLVER" == "2.0" ]; then
    LL20
elif [ "$LLVER" == "2.2" ]; then
    LL22
elif [ "$LLVER" == "2.4" ]; then
    zenity --info --text="You are already running the latest release"
    exit 0
fi

RUN

exit 0
Reply
#17

lite-upgrade-system-series2

Code:
#!/bin/bash
#----------------------------------------------------------------
# Description: Linux Lite Upgrade Script - System
# About: For Linux Lite 2.- Series only
# Authors: Misko_2083, Jerry Bezencon 2015
# Website: https://www.linuxliteos.com
#----------------------------------------------------------------

# Ensure multi-language support
export LANG=C

# 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 username
_USER="$@"

LL20SYSTEM() {
# Invoke arrays
ARRAYB=()
ARAYC=()

#Check the arch
arch=$(uname -m)

case "$arch" in
    x86)    arch="x86"  ;;
    i?86)   arch="x86"  ;;
    amd64)  arch="amd64"    ;;
    x86_64) arch="amd64"    ;;
    * ) echo "Your Arch '$arch' -> Its not supported."  ;;
esac

# Populate arrays based on the arch
case "$arch" in
    x86)
    ARRAYB+=('BUPETCSKEL')
    ARRAYC+=('UPD1')
    ARRAYC+=('ERASEDPKG')
    ARRAYC+=('CRLCL')
    ARRAYC+=('INPKCL')
    ARRAYC+=('ADDWALL1')
    ARRAYC+=('UPLSBISSUE')
    ARRAYC+=('LBPLYUB')
    ARRAYC+=('SYSAUTH')
    ARRAYC+=('ROOTTERTHEM')
    ARRAYC+=('NWLOG')
    ;;
    amd64)
    ARRAYB+=('BUPETCSKEL64')
    ARRAYC+=('UPD1')
    ARRAYC+=('ERASEDPKG')
    ARRAYC+=('CRLCL')
    ARRAYC+=('INPKCL64')
    ARRAYC+=('ADDWALL1')
    ARRAYC+=('UPLSBISSUE')
    ARRAYC+=('LBPLYUB')
    ARRAYC+=('SYSAUTH')
    ARRAYC+=('ROOTTERTHEM')
    ARRAYC+=('NWLOG')
    ;;
esac
}

LL22SYSTEM() {
# Invoke arrays
ARRAYB=()
ARRAYC=()

#Check the arch
arch=$(uname -m)

case "$arch" in
    x86)    arch="x86"  ;;
    i?86)   arch="x86"  ;;
    amd64)  arch="amd64"    ;;
    x86_64) arch="amd64"    ;;
    * ) echo "Your Arch '$arch' -> Its not supported."  ;;
esac

# Populate arrays based on the arch
case "$arch" in
    x86)
    ARRAYB+=('BUPETCSKEL')
    ARRAYC+=('UPD1')
    ARRAYC+=('ERASEDPKG')
    ARRAYC+=('CRLCL')
    ARRAYC+=('INPKCL')
    ARRAYC+=('ADDWALL1')
    ARRAYC+=('UPLSBISSUE')
    ARRAYC+=('LBPLYUB')
    ARRAYC+=('SYSAUTH')
    ARRAYC+=('ROOTTERTHEM')
    ARRAYC+=('NWLOG')
    ;;
    amd64)
    ARRAYB+=('BUPETCSKEL64')
    ARRAYC+=('UPD1')
    ARRAYC+=('ERASEDPKG')
    ARRAYC+=('CRLCL')
    ARRAYC+=('INPKCL64')
    ARRAYC+=('ADDWALL1')
    ARRAYC+=('UPLSBISSUE')
    ARRAYC+=('LBPLYUB')
    ARRAYC+=('SYSAUTH')
    ARRAYC+=('ROOTTERTHEM')
    ARRAYC+=('NWLOG')
    ;;
esac
}

# Backup /etc/skel/
BUPETCSKEL() {
       echo "#Backing up /etc/skel files..."
        sleep 2
        cp /etc/skel/.config/lxterminal/lxterminal.conf /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.config/xfce4/panel/whiskermenu-1.rc /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.local/share/applications/exo-terminal-emulator.desktop /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.local/share/applications/exo-file-manager.desktop /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.local/share/applications/exo-file-manager.desktop /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.local/share/applications/alacarte-made-2.desktop /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.local/share/applications/alacarte-made-4.desktop /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.local/share/applications/alacarte-made-5.desktop /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.local/share/applications/alacarte-made-6.desktop /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.local/share/applications/alacarte-made-7.desktop /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.local/share/applications/alacarte-made-10.desktop.backup /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.local/share/applications/alacarte-made-11.desktop.backup /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.config/Thunar/uca.xml /etc/skel/.llupgradebackup/2.4

}

BUPETCSKEL64() {
    echo "#Backing up /etc/skel files..."
        sleep 2
        cp /etc/skel/.config/lxterminal/lxterminal.conf /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.config/xfce4/panel/whiskermenu-1.rc /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.local/share/applications/exo-terminal-emulator.desktop /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.local/share/applications/exo-file-manager.desktop /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.local/share/applications/exo-file-manager.desktop /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.local/share/applications/alacarte-made-2.desktop /etc/skel/.llupgradebackup/2.4
        cp /etc/skel/.config/Thunar/uca.xml /etc/skel/.llupgradebackup/2.4
}

# Get list of available updated packages
UPD1() {
#sed 's/^\(.\{128\}\).*/\1/' Display only the first 128 characters
UPDATER=$( stdbuf -oL /bin/bash \-c '(sudo apt-get update \-y )' 2>&1 |
stdbuf -oL sed -n -e 's/^\(.\{128\}\).*/\1/' -e '/\[*$/ s/^/# /p' -e '/\*$/ s/^/# /p' |
zenity --progress --percentage="$PERCENTAGE"  --title="Updating package information..." \
--width=600 --auto-close )
            if [ $? = 1 ]; then
                zenity --info --title="Lite Upgrade" --text="Error:\n${line}"
            fi   
unset UPDATER
}

# Erase existing available info
ERASEDPKG() {
UPDATER=$( stdbuf -oL /bin/bash \-c '(sudo dpkg --clear-avail )' 2>&1 |
stdbuf -oL sed -n -e 's/^\(.\{128\}\).*/\1/' -e '/\[*$/ s/^/# /p' -e '/\*$/ s/^/# /p' |
zenity --progress --percentage="$PERCENTAGE"  --title="Clearing dpkg..." \
--width=600 --auto-close )
            if [ $? = 1 ]; then
                zenity --info --title="Lite Upgrade" --text="Error:\n${line}"
            fi   
unset UPDATER
}

# Create /etc/apt/apt.conf.d/local to leave /etc/issue and /etc/lsb-release defaults (only needed in LL 2.2)
CRLCL() {
UPDATER=$( stdbuf -oL /bin/bash \-c '(cd /tmp && wget http://repo.linuxliteos.com/upgrade/local && sudo mv local /etc/apt/apt.conf.d/ && sudo chown root:root /etc/apt/apt.conf.d/local && sleep 2 )' 2>&1 |
stdbuf -oL sed -n -e 's/^\(.\{128\}\).*/\1/' -e '/\[*$/ s/^/# /p' -e '/\*$/ s/^/# /p' |
zenity --progress --percentage="$PERCENTAGE"  --title="Automating packaging defaults..." \
--width=600 --auto-close )
            if [ $? = 1 ]; then
                zenity --info --title="Lite Upgrade" --text="Error:\n${line}"
            fi   
unset UPDATER
}

# Install new packages, remove obsolete packages, clean up
INPKCL() {
UPDATER=$( stdbuf -oL /bin/bash \-c '(sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \-y && sudo apt-get install locate vpnc openconnect network-manager-openconnect-gnome network-manager-vpnc-gnome gvfs-fuse network-manager-openvpn mugshot ntp ntpdate tumbler-plugins-extra mtpfs libmtp9 libmtp-runtime libmtp-common mtp-tools libnet-smtp-ssl-perl exfat-fuse exfat-utils inxi libreoffice-gnome dmz-cursor-theme file-roller lite-welcome lite-cleaner catfish deja-dup system-config-date light-locker thunar-archive-plugin whiskermenu \-y && sudo apt-get update \-y && sudo apt-get remove xarchiver \-y && sudo apt-get autoremove \-y && sudo apt-get clean )' 2>&1 |
stdbuf -oL sed -n -e 's/^\(.\{128\}\).*/\1/' -e '/\[*$/ s/^/# /p' -e '/\*$/ s/^/# /p' |
zenity --progress --percentage="$PERCENTAGE"  --title="Installing new packages..." \
--width=600 --auto-close )
unset UPDATER
}

INPKCL64() {
UPDATER=$( stdbuf -oL /bin/bash \-c '(sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade \-y && sudo apt-get install locate vpnc openconnect network-manager-openconnect-gnome network-manager-vpnc-gnome gvfs-fuse network-manager-openvpn mugshot ntp ntpdate tumbler-plugins-extra mtpfs libmtp9:amd64 libmtp-runtime libmtp-common mtp-tools libnet-smtp-ssl-perl exfat-fuse exfat-utils inxi libreoffice-gnome dmz-cursor-theme file-roller lite-welcome lite-cleaner catfish deja-dup system-config-date light-locker thunar-archive-plugin whiskermenu \-y && sudo apt-get update \-y && sudo apt-get remove xarchiver \-y && sudo apt-get autoremove \-y && sudo apt-get clean )' 2>&1 |
stdbuf -oL sed -n -e 's/^\(.\{128\}\).*/\1/' -e '/\[*$/ s/^/# /p' -e '/\*$/ s/^/# /p' |
zenity --progress --percentage="$PERCENTAGE"  --title="Installing new packages..." \
--width=600 --auto-close )
            if [ $? = 1 ]; then
                zenity --info --title="Lite Upgrade" --text="Error:\n${line}"
            fi   
unset UPDATER
}

# Add new wallpapers
ADDWALL1() {
UPDATER=$( stdbuf -oL /bin/bash \-c '(cd /tmp && wget http://repo.linuxliteos.com/upgrade/wallpapers/walls.tar.gz && sudo tar -xvf walls.tar.gz -C /usr/share/backgrounds/xfce/ && cd /usr/share/backgrounds/xfce/ && sudo chown root:root *.jpg && sudo chown root:root *.png && sudo chmod 644 *.jpg && sudo chmod 644 *.jpeg && sudo chmod 644 *.png && sleep 2 )' 2>&1 |
stdbuf -oL sed -n -e 's/^\(.\{128\}\).*/\1/' -e '/\[*$/ s/^/# /p' -e '/\*$/ s/^/# /p' |
zenity --progress --percentage="$PERCENTAGE"  --title="Adding new wallapapers..." \
--width=600 --auto-close )
unset UPDATER
}

# Update lsb_release and issue files /etc changes, update /etc/llver
UPLSBISSUE() {
UPDATER=$( stdbuf -oL /bin/bash \-c '(sudo sed -i "s/DISTRIB_DESCRIPTION=.*/DISTRIB_DESCRIPTION=\"Linux Lite 2.4\"/g" /etc/lsb-release && echo "Linux Lite 2.4" | sudo tee /etc/llver && echo "Linux Lite 2.4 LTS \n \l" | sudo tee /etc/issue && sleep 2 )' 2>&1 |
stdbuf -oL sed -n -e '/\[*$/ s/^/# /p' -e '/\*$/ s/^/# /p'|
zenity --progress --percentage="$PERCENTAGE"  --title="Updating version information..." \
--width=600 --auto-close )
            if [ $? = 1 ]; then
                zenity --info --title="Lite Upgrade" --text="Error:\n${line}"
            fi   
unset UPDATER
}

# /lib/plymouth/themes/ubuntu-text/ changes
LBPLYUB() {
UPDATER=$( stdbuf -oL /bin/bash \-c '(sudo sed -i "s/^title=Linux Lite.*$/title=Linux Lite 2.4/g" /lib/plymouth/themes/ubuntu-text/ubuntu-text.plymouth && sudo sed -i "s/^title=Ubuntu.*$/title=Linux Lite 2.4/g" /lib/plymouth/themes/ubuntu-text/ubuntu-text.plymouth && sudo sed -i "s/black=0x2c001e/black=0x000000/g" /lib/plymouth/themes/ubuntu-text/ubuntu-text.plymouth && sudo sed -i "s/white=0xffffff/white=0xffffff/g" /lib/plymouth/themes/ubuntu-text/ubuntu-text.plymouth && sudo sed -i "s/brown=0xff4012/brown=0xffff00/g" /lib/plymouth/themes/ubuntu-text/ubuntu-text.plymouth && sudo sed -i "s/blue=0x988592/blue=0x000000/g" /lib/plymouth/themes/ubuntu-text/ubuntu-text.plymouth && sudo update-initramfs -u )' 2>&1 |
stdbuf -oL sed -n -e 's/^\(.\{128\}\).*/\1/' -e '/\[*$/ s/^/# /p' -e '/\*$/ s/^/# /p' |
zenity --progress --percentage="$PERCENTAGE"  --title="Updating boot configuration please wait..." \
--width=600 --auto-close )
            if [ $? = 1 ]; then
                zenity --info --title="Lite Upgrade" --text="Error:\n${line}"
            fi   
unset UPDATER
}

# Fix syslog, auth.log not logging
SYSAUTH() {
UPDATER=$( stdbuf -oL /bin/bash \-c '(sudo chown syslog:adm /var/log/syslog && sudo chmod 640 /var/log/syslog && sudo chown syslog:adm /var/log/auth.log && sudo chmod 640 /var/log/auth.log && sudo service rsyslog restart )' 2>&1 |
stdbuf -oL sed -n -e 's/^\(.\{128\}\).*/\1/' -e '/\[*$/ s/^/# /p' -e '/\*$/ s/^/# /p' |
zenity --progress --percentage="$PERCENTAGE"  --title="Fixing syslog and auth.log..." \
--width=600 --auto-close )
            if [ $? = 1 ]; then
                zenity --info --title="Lite Upgrade" --text="Error:\n${line}"
            fi   
}

# Set root's Terminal theme
ROOTTERTHEM() {
UPDATER=$( stdbuf -oL /bin/bash \-c '(sudo mv /root/.config/lxterminal/lxterminal.conf /root/.config/lxterminal/lxterminal.conf.backup && sudo cp /etc/skel/.config/lxterminal/lxterminal.conf /root/.config/lxterminal/ && sudo chown root:root /root/.config/lxterminal/lxterminal.conf && sleep 2 )' 2>&1 |
stdbuf -oL sed -n -e 's/^\(.\{128\}\).*/\1/' -e '/\[*$/ s/^/# /p' -e '/\*$/ s/^/# /p' |
zenity --progress --percentage="$PERCENTAGE"  --title="Setting Terminal theme..." \
--width=600 --auto-close )
            if [ $? = 1 ]; then
                zenity --info --title="Lite Upgrade" --text="Error:\n${line}"
            fi   
unset UPDATER
}

# Update to new login screen
NWLOG() {
UPDATER=$( stdbuf -oL /bin/bash \-c '(cd /tmp && wget https://github.com/linuxlite/litelogin/archive/master.zip && unzip master.zip && sudo cp /tmp/litelogin-master/usr/share/lightdm-webkit/themes/linuxlite/index.theme /usr/share/lightdm-webkit/themes/linuxlite && sudo cp /tmp/litelogin-master/usr/share/lightdm-webkit/themes/linuxlite/index.html /usr/share/lightdm-webkit/themes/linuxlite && sudo cp /tmp/litelogin-master/usr/share/lightdm-webkit/themes/linuxlite/low_contrast_linen.png /usr/share/lightdm-webkit/themes/linuxlite && sudo cp /tmp/litelogin-master/usr/share/lightdm-webkit/themes/linuxlite/style.css /usr/share/lightdm-webkit/themes/linuxlite && sudo rm -rf master.zip && sudo rm -rf litelogin-master/ && sleep 2 )' 2>&1 |
stdbuf -oL sed -n -e 's/^\(.\{128\}\).*/\1/' -e '/\[*$/ s/^/# /p' -e '/\*$/ s/^/# /p' |
zenity --progress --percentage="$PERCENTAGE"  --title="Updating to new login theme..." \
--width=600 --auto-close )
            if [ $? = 1 ]; then
                zenity --info --title="Lite Upgrade" --text="Error:\n${line}"
            fi   
unset UPDATER
return
}

#Check the version and start  the appropriate function
LLVER=$(awk '{print $3}' /etc/llver)

if [ "$LLVER" == "2.0" ]; then
    LL20SYSTEM
elif [ "$LLVER" == "2.2" ]; then
    LL22SYSTEM
elif [ "$LLVER" == "2.4" ]; then
    zenity --info --text="You are already running the latest release"
    exit 0
fi


# Check if ARRAYB is empty
# If it is skip the execution
if [ ${#ARRAYB[@]} -ne 0 ]; then

    x=0
    for k in "${!ARRAYB[@]}"; do  x=$(( $x + 1 )); done  # Get the total number of selected items in array B

    TOTAL_LINES=$x
    i=0

    printf '%s \n' "${ARRAYB[@]}"|
    while read  line
        do
            $line     # Execute functions one by one
            if [ $? = 1 ]; then
                zenity --error --title="Lite Upgrade" --text="There was an error while performing upgrades:\n ${line}"
                exit 1
            fi   
        let i++
         (( PERCENTAGE = 100 \* ${i} / ${TOTAL_LINES} ))
         echo "$PERCENTAGE"

        if [ "$PERCENTAGE" == "100" ]; then
            echo "#Done"
            sleep 2
        fi
   
    done| zenity --progress  --title="Lite Upgrade" --auto-kill --auto-close --width=300
fi

# Check if ARRAYC is empty
# If it is skip the execution
if [ ${#ARRAYC[@]} -ne 0 ]; then

    x=0
    for k in "${!ARRAYC[@]}"; do  x=$(( $x + 1 )); done  # Get the total number of selected items in the array

    i=0
    TOTAL_LINES=$x
    PERCENTAGE=0
    printf '%s \n' "${ARRAYC[@]}"|
    while read  line
        do
        (( PERCENTAGE = 100 \* ${i} / ${TOTAL_LINES} ))
            $line     # Execute functions one by one
            if [ $? = 1 ]; then
                zenity --info --title="Lite Upgrade" --text="Error:\n${line}"
            fi   
        let i++

        if [ "$PERCENTAGE" == "100" ]; then
            echo "#Done"
            sleep 2
        fi
   
    done
fi

unset ARAYB
unset ARAYC
unset _USER
Reply
#18

Looks like you are right, I'll contact our host and get them to look into this.

Download your free copy of Linux Lite today.

Jerry Bezencon
Linux Lite Creator

"Do not correct a fool, or he will hate you; correct a wise man and he will appreciate you."

[Image: X5qGkCg.png]

[Image: 0op1GNe.png] [Image: LgJ2mtP.png] [Image: vLZcFUE.png] [Image: lrUHro3.jpg]
Reply
#19

Maybe that script has lines that are too long for the website to handle.  Just throwing imy two Serbian dinars on that issue. :)
A few days left for 2.4 to be ready. Are all the things that need to be done going the right w at least there is a working version right way?
Any news on the update gui?
Reply
#20

(03-21-2015, 09:53 PM)misko_2083 link Wrote:  A few days left for 2.4 to be ready. Are all the things that need to be done going the right w at least there is a working version right way?

I've tested your script on LL 32bit only, I've been working but my next days off start next Thursday 26th so I intend to have all testing completed by then. After that I'll build the final iso, test that on Friday and Saturday then we should be good to go. That leaves us 4 days spare before release date. So far all is right on target and looking good :)


(03-21-2015, 09:53 PM)misko_2083 link Wrote:  Any news on the update gui?

I've posted a bounty here - https://www.bountysource.com/issues/9738...ossible-20 gerito is also busy so we will have to wait. If it isnt ready in time for 2.4 we can still release it, then change it later.

Download your free copy of Linux Lite today.

Jerry Bezencon
Linux Lite Creator

"Do not correct a fool, or he will hate you; correct a wise man and he will appreciate you."

[Image: X5qGkCg.png]

[Image: 0op1GNe.png] [Image: LgJ2mtP.png] [Image: vLZcFUE.png] [Image: lrUHro3.jpg]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)