01-04-2015, 10:42 PM
Code:
#!/bin/bash
#----------------------------------------------------------------
# Description: Linux Lite Upgrade Script
# 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 list of available updated packages
zenity --question --title="Linux Lite Upgrade Utility" --window-icon="/usr/share/icons/zenity-llcc.png" --text="We will now Upgrade to Linux Lite 2.2\n\nPlease ensure you are connected to the internet before you start.\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 )
# Erase existing available info
sudo dpkg --clear-avail
else
exit 0
fi
# Install new packages, remove obsolete packages, clean up
x=$( stdbuf -oL /bin/bash \-c '(sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade \-y && sudo apt-get install inxi libreoffice-gnome dmz-cursor-theme file-roller lite-welcome lite-cleaner catfish deja-dup system-config-date light-locker thunar-archive-plugin \-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/^/# /p' -e '/\*$/ s/^/# /p'|
zenity --progress --title="Upgrading to Linux Lite 2.2..." --pulsate \
--width=600 --auto-close )
# Reboot dialogue
# Credit to xunil: http://bbs.archbang.org/viewtopic.php?id=279
title="Select Reboot to complete the Upgrade"
exit_type=`zenity --width="380" --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"
exit
fi
# Action to perform by user
if [ "$exit_type" = "Reboot" ]
then
# Do Reboot here
sudo shutdown -r now | zenity --progress --percentage=95 --title=Reboot --auto-close --auto-kill --no-cancel --width=300
elif [ "$exit_type" = "Shutdown" ]
then
# Do Shutdown here
sudo shutdown -h now | zenity --progress --percentage=95 --title=Shutdown --auto-close --auto-kill --no-cancel --width=300
else
# Do Cancel here
exit 0
fi
# #############BELOW CODE NEEDS COMPLETION AND INTEGRATING INTO ABOVE CODE#############
# #############CODE COMPLETED#############
# Add new wallapapers
cd /tmp
wget http://repo.linuxliteos.com/upgrade/2.0-2.2/walls-2.2.tar.gz
tar -xvf walls-2.2.tar.gz /usr/share/backgrounds/xfce/
cd /usr/share/backgrounds/xfce/
sudo chown root:root *.jpg
sudo chown root:root *.png
# Update plymouth, lsb_release and issue files
# /etc changes
sudo sed -i "s/Linux Lite 2.0/Linux Lite 2.2/g" /etc/llver
sudo sed -i "s/Linux Lite 2.0/Linux Lite 2.2/g" /etc/lsb-release
sudo sed -i "s/Linux Lite 2.0 LTS \n \l/Linux Lite 2.2 LTS \n \l/g" /etc/issue
# /lib/plymouth/themes/ubuntu-text/ changes
sudo sed -i "s/Ubuntu 14.04/Linux Lite 2.2/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
# Update to new login screen
cd /tmp
wget https://github.com/linuxlite/litelogin/archive/master.zip
unzip master.zip
sudo cp /litelogin-master/usr/share/lightdm-webkit/themes/linuxlite/index.theme /usr/share/lightdm-webkit/themes/linuxlite
sudo cp /litelogin-master/usr/share/lightdm-webkit/themes/linuxlite/index.html /usr/share/lightdm-webkit/themes/linuxlite
sudo cp /litelogin-master/usr/share/lightdm-webkit/themes/linuxlite/low_contrast_linen.png /usr/share/lightdm-webkit/themes/linuxlite
sudo cp /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/
# #############CODE UNCOMPLETED#############
# Set lite-welcome to autostart on first boot - to do
# Requires script to locate default user, and run the following commands as that user
# command here
# ln -s /usr/share/applications/lite_welcome.desktop /home/USER/.config/autostart ????
# 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, Thunar.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
# Requires script to locate default user, and run the following commands as that user
# commands here
# 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
# Requires script to locate default user, and run the following commands as that user
# commands here
# Add new right click actions to Thunar - to do (path is /home/USER/.config/Thunar/uca.xml)
# Requires script to locate default user, and run the following commands as that user
# commands hereDownload 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]](https://imgur.com/X5qGkCg.png)

