Reliability improvements

This commit is contained in:
GermanBread 2021-01-05 19:32:11 +00:00
parent d7bbd596a4
commit 396c62af5b
1 changed files with 19 additions and 17 deletions

36
LULI.sh
View File

@ -77,7 +77,8 @@ if [[ $method == 1 ]]; then
Warning "Warning:\n\tBlindly running software as root is a massive security issue.\n\tIf you don't fully trust the software you're running DON'T RUN IT AS ROOT.\n\tIf you know exactly what you are doing, continue.\n\tOtherwise restart this script and choose the second option.\n" Warning "Warning:\n\tBlindly running software as root is a massive security issue.\n\tIf you don't fully trust the software you're running DON'T RUN IT AS ROOT.\n\tIf you know exactly what you are doing, continue.\n\tOtherwise restart this script and choose the second option.\n"
Info "Please enter your password" Info "Please enter your password"
if [[ "$(sudo -k whoami)" != "root" ]]; then sudo -K
if [[ "$(sudo whoami)" != "root" ]]; then
Error "Authentication failed" Error "Authentication failed"
exit exit
fi fi
@ -118,21 +119,20 @@ case $method in
rm -rf Lightcord; rm -rf Lightcord;
rm -rf lightcord-linux-x64.*; rm -rf lightcord-linux-x64.*;
SubInfo "Downloading Lightcord" SubInfo "Downloading Lightcord"
wget https://lightcord.org/api/v1/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x64.zip; wget -O lightcord-linux-x64.zip https://lightcord.org/api/v1/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x64.zip;
unzip lightcord-linux-x64.zip -d Lightcord; unzip lightcord-linux-x64.zip -d Lightcord;
rm lightcord-linux-x64.zip; prev_pwd = $(pwd);
prev_pwd = pwd;
cd Lightcord; cd Lightcord;
chmod +x ./lightcord; chmod +x ./lightcord;
cd ..; cd ..;
sudo mv Lightcord/ /opt/; sudo mv Lightcord/ /opt/;
rm Lightcord/; rm Lightcord/;
SubInfo "Downloading Lightcord icon" SubInfo "Downloading Lightcord icon"
wget https://raw.githubusercontent.com/Lightcord/LightcordLogos/master/lightcord/lightcord.svg; wget -O lightcord.svg https://raw.githubusercontent.com/Lightcord/LightcordLogos/master/lightcord/lightcord.svg;
sudo mv lightcord.svg /usr/share/pixmaps; sudo mv lightcord.svg /usr/share/pixmaps;
sudo rm -rf /usr/share/applications/Lightcord.desktop
SubInfo "Creating Desktop entry" SubInfo "Creating Desktop entry"
sudo echo -e "[Desktop Entry]\nName=Lightcord\nComment[fr_FR]=Un client Discord simple et personalisable\nComment=A simple - customizable - Discord Client\nExec=/opt/Lightcord/lightcord\nIcon=lightcord\nTerminal=false\nType=Application\nCategories=Network;InstantMessaging;P2P;" >> /usr/share/applications/Lightcord.desktop echo -e "[Desktop Entry]\nName=Lightcord\nComment[fr_FR]=Un client Discord simple et personalisable\nComment=A simple - customizable - Discord Client\nExec=/opt/Lightcord/lightcord\nIcon=lightcord\nTerminal=false\nType=Application\nCategories=Network;InstantMessaging;P2P;" > Lightcord.desktop
sudo mv Lightcord.desktop /usr/share/applications/Lightcord.desktop
sudo sudo chmod +x /usr/share/applications/Lightcord.desktop; sudo sudo chmod +x /usr/share/applications/Lightcord.desktop;
SubInfo "Cleaning up" SubInfo "Cleaning up"
rm -rf Lightcord.*; rm -rf Lightcord.*;
@ -146,9 +146,9 @@ case $method in
sudo rm -r /opt/Lightcord; sudo rm -r /opt/Lightcord;
SubInfo "Deleting Lightcord Icon" SubInfo "Deleting Lightcord Icon"
sudo rm /usr/share/pixmaps/lightcord.svg; sudo rm /usr/share/pixmaps/lightcord.svg;
SubInfo "Deleting Desktop entry" SubInfo "Deleting Desktop Entry"
sudo rm /usr/share/applications/Lightcord.desktop; sudo rm /usr/share/applications/Lightcord.desktop;
sudo rm -f /home/*/.local/share/applications/Lightcord.desktop; sudo rm /home/*/.local/share/applications/Lightcord.desktop;
;; ;;
3) # Update LC 3) # Update LC
@ -160,16 +160,14 @@ case $method in
SubInfo "Deleting old Lightcord install" SubInfo "Deleting old Lightcord install"
sudo rm -r /opt/Lightcord; sudo rm -r /opt/Lightcord;
SubInfo "Downloading Lightcord" SubInfo "Downloading Lightcord"
wget https://lightcord.org/api/v1/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x64.zip; wget -O https://lightcord.org/api/v1/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x64.zip;
unzip lightcord-linux-x64.zip -d Lightcord; unzip lightcord-linux-x64.zip -d Lightcord;
rm lightcord-linux-x64.zip; prev_pwd = $(pwd);
prev_pwd = pwd;
cd Lightcord; cd Lightcord;
chmod +x ./lightcord; chmod +x ./lightcord;
cd ..; cd ..;
sudo mv Lightcord/ /opt/; sudo mv Lightcord/ /opt/;
SubInfo "Cleaning up" SubInfo "Cleaning up"
rm Lightcord/;
rm -rf Lightcord.*; rm -rf Lightcord.*;
rm -rf Lightcord; rm -rf Lightcord;
rm -rf lightcord-linux-x64.*; rm -rf lightcord-linux-x64.*;
@ -229,18 +227,18 @@ case $method in
2) # Uninstall LC 2) # Uninstall LC
Info 'Uninstalling Lightcord' Info 'Uninstalling Lightcord'
rm -rf ~/.lightcord; rm -r ~/.lightcord;
rm ~/.local/share/icons/hicolor/512x512/apps/lightcord.png; rm ~/.local/share/icons/hicolor/512x512/apps/lightcord.png;
rm ~/.local/share/applications/lightcord.desktop; rm ~/.local/share/applications/lightcord.desktop;
;; ;;
3) # Update LC 3) # Update LC
Info 'Updating Lightcord' Info 'Updating Lightcord'
rm -f ~/.lightcord/lightcord.AppImage; rm ~/.lightcord/lightcord.AppImage;
wget -O lightcord.AppImage $appimage; wget -O lightcord.AppImage $appimage;
mkdir -p ~/.lightcord; mkdir -p ~/.lightcord;
mv lightcord.AppImage ~/.lightcord; mv lightcord.AppImage ~/.lightcord;
chmod +x ~/.lightcord/lightcord.AppImage ; chmod +x ~/.lightcord/lightcord.AppImage;
;; ;;
*) *)
@ -259,12 +257,16 @@ read a;
case $a in case $a in
y) y)
Info "Kept install script"
exit; exit;
;; ;;
Y) Y)
Info "Kept install script"
exit; exit;
;; ;;
esac esac
# Remove the script # Remove the script
rm -f LULI.sh; rm LULI.sh;
Info "Removed install script"
exit;