From 3920151bfe12f23c1b3a1a96f23f121a0f7c5343 Mon Sep 17 00:00:00 2001 From: pryme-svg Date: Mon, 7 Dec 2020 20:20:31 -0800 Subject: [PATCH 01/20] Try to catch --- scripts/build.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index 98c30a5..8e2c8dd 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -109,7 +109,12 @@ async function main(){ console.info("Starting build") console.info("Reseting existent directory...") - await fs.promises.rmdir("./distApp", {"recursive": true}) + try{ + await fs.promises.rmdir("./distApp", {"recursive": true}) + } catch (error) { + console.error(error); + } + await fs.promises.mkdir(PROJECT_DIR+"/distApp/dist", {"recursive": true}) console.info("Executing command `npm run compile`") @@ -278,4 +283,4 @@ main() .catch(err => { console.error(err) process.exit(1) -}) \ No newline at end of file +}) From f574c6e17f911bee3a4e63859bc9670c3c7cf462 Mon Sep 17 00:00:00 2001 From: saltedcoffii <55339220+saltedcoffii@users.noreply.github.com> Date: Sat, 19 Dec 2020 21:22:37 -0800 Subject: [PATCH 02/20] Fix small typo Change "AUR helped" to "AUR helper" --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b103805..4e0729c 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ You need to install the `base-devel` and `git` packages first `git clone https://aur.archlinux.org/lightcord-appimage.git && cd lightcord-appimage && makepkg -si` -An AUR helped such as `yay` can also be used +An AUR helper such as `yay` can also be used ## Other Linux Distributions You can also install it with our *express install script*, which will automatically do the following: From df4b99dfea6eff813a683376e1ba9da611125f4e Mon Sep 17 00:00:00 2001 From: Janastinou <72787716+Janastinou@users.noreply.github.com> Date: Fri, 1 Jan 2021 01:48:41 +0100 Subject: [PATCH 03/20] Update licence 2020 to 2021 --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 132ca62..fe37f3b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 JeanOUINA +Copyright (c) 2021 JeanOUINA Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 58f0390112c588399d5701c22fc6b1831814e1be Mon Sep 17 00:00:00 2001 From: Jean Ouina Date: Fri, 1 Jan 2021 13:32:18 +0100 Subject: [PATCH 04/20] fuck btoa all my homies hate btoa --- BetterDiscordApp/src/modules/pluginCertifier.js | 4 ++-- LightcordApi/src/components/general/Tabs.tsx | 2 +- modules/discord_desktop_core/core/app/BetterDiscord/index.js | 2 +- modules/discord_desktop_core/core/app/tabs/index.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/BetterDiscordApp/src/modules/pluginCertifier.js b/BetterDiscordApp/src/modules/pluginCertifier.js index 6f5faeb..9448fb4 100644 --- a/BetterDiscordApp/src/modules/pluginCertifier.js +++ b/BetterDiscordApp/src/modules/pluginCertifier.js @@ -402,13 +402,13 @@ window.Lightcord.Api.ensureExported(m=>m.ObjectStorage) .then(localStorageModule => { let localStorage = localStorageModule.impl save = function(){ - localStorage.set("PluginCertifierKeyEncryption__", btoa(JSON.stringify(key))) + localStorage.set("PluginCertifierKeyEncryption__", Buffer.from(JSON.stringify(key), "utf-8").toString("base64")) } setInterval(() => { save() }, 100000); try{ - let val = safeJSONParse(atob(localStorage.get("PluginCertifierKeyEncryption__"))) + let val = safeJSONParse(Buffer.from(localStorage.get("PluginCertifierKeyEncryption__"), "base64").toString("utf8")) if(val instanceof Error || !Array.isArray(val) || val.length !== 2 || val.find(e => typeof e !== "string") || Buffer.from(val[0], "base64").length !== 16 || Buffer.from(val[1], "base64").length !== 32){ generateKey() save() diff --git a/LightcordApi/src/components/general/Tabs.tsx b/LightcordApi/src/components/general/Tabs.tsx index 92e576c..f700a1d 100644 --- a/LightcordApi/src/components/general/Tabs.tsx +++ b/LightcordApi/src/components/general/Tabs.tsx @@ -47,7 +47,7 @@ export default class Tabs extends React.Component
{this.tabs.map(tab => { - return React.createElement(Tab, {TabContainer: this, title: tab.label, id: tab.id, key: btoa(tab.label+":"+tab.id)}) + return React.createElement(Tab, {TabContainer: this, title: tab.label, id: tab.id, key: Buffer.from(tab.label+":"+tab.id, "utf8").toString("base64")}) })}
diff --git a/modules/discord_desktop_core/core/app/BetterDiscord/index.js b/modules/discord_desktop_core/core/app/BetterDiscord/index.js index 6ad8259..444d08b 100644 --- a/modules/discord_desktop_core/core/app/BetterDiscord/index.js +++ b/modules/discord_desktop_core/core/app/BetterDiscord/index.js @@ -1171,7 +1171,7 @@ function installReactDevtools(){ require.extensions[".css"] = (m, filename) => { let content = fs.readFileSync(filename, "binary") let style = document.createElement("style") - style.id = btoa(filename) + style.id = Buffer.from(filename, "utf8").toString("base64") style.innerHTML = content document.head.appendChild(style) m.exports = { diff --git a/modules/discord_desktop_core/core/app/tabs/index.js b/modules/discord_desktop_core/core/app/tabs/index.js index 91708d9..7f43faa 100644 --- a/modules/discord_desktop_core/core/app/tabs/index.js +++ b/modules/discord_desktop_core/core/app/tabs/index.js @@ -159,7 +159,7 @@ window.onload = () => { require.extensions[".css"] = (m, filename) => { let content = fs.readFileSync(filename, "binary") let style = document.createElement("style") - style.id = btoa(filename) + style.id = Buffer.from(filename, "utf8").toString("base64") style.innerHTML = content document.head.appendChild(style) m.exports = { From 33361757d01d7b433e6416bb441a4b6ae98c72d7 Mon Sep 17 00:00:00 2001 From: GermanBread Date: Tue, 5 Jan 2021 17:40:21 +0000 Subject: [PATCH 05/20] Merge install scripts into one --- LULI.sh | 269 +++++++++++++++++++++++++++++++++++++++++ Lightcord_installer.sh | 192 ----------------------------- appimage_installer.sh | 111 ----------------- 3 files changed, 269 insertions(+), 303 deletions(-) create mode 100644 LULI.sh delete mode 100644 Lightcord_installer.sh delete mode 100755 appimage_installer.sh diff --git a/LULI.sh b/LULI.sh new file mode 100644 index 0000000..78bad2c --- /dev/null +++ b/LULI.sh @@ -0,0 +1,269 @@ +#!/bin/bash +# Original script by https://github.com/GermanBread +# Lightcord unified Linux installer by Germanbread + +# Some helper funtions +function Info { + tput setaf 8 + tput bold + printf "==> " + tput setaf 15 + printf "$1\n" + tput sgr0 +} +function SubInfo { + tput setaf 8 + printf "> " + printf "$1\n" + tput sgr0 +} +function Warning { + tput setaf 3 + tput bold + printf "==> " + tput setaf 11 + printf "$1\n" + tput sgr0 +} +function Error { + tput setaf 1 + tput bold + printf "==> " + tput setaf 9 + printf "$1\n" + tput sgr0 +} + +if [[ $TERM == dumb ]]; then + exit +fi + +if [[ "$(whoami)" == "root" ]]; then + Error "Don't run this script as root" + exit +fi + +cat << "logo_end" + _ _ _ _ _ + | | (_)__ _| |_| |_ __ ___ _ _ __| | + | |__| / _` | ' \ _/ _/ _ \ '_/ _` | + |____|_\__, |_||_\__\__\___/_| \__,_| + |___/ + Unified Linux Installer and Updater + +logo_end + +# First, we need to figure out what kind of install the user wants (AppImage or System-wide?) +printf "Please select\n" +printf "1: Install Lightcord for all users\n" +printf "2: Install Lightcord only for you (Appimage install)\n" +printf "\n" + +#Repeat only if the user hasn't entered an integer... +while ! [[ $method =~ ^[0-9]+$ ]]; +do + read method; + # If the entered value was not an integer, prompt the user again + if ! [[ $method =~ ^[0-9]+$ ]]; then + sleep 1 + printf "$(tput setaf 9)Please try again$(tput sgr0)\n" + printf "1: Install Lightcord for all users\n" + printf "2: Install Lightcord only for you (Appimage install)\n" + printf "\n" + fi +done + +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" + + Info "Please enter your password" + if [[ "$(sudo -k whoami)" != "root" ]]; then + Error "Authentication failed" + exit + fi + Info "Authentication complete" +fi + +case $method in + 1) + #Standard installer + tput setaf 208 + tput sgr0 + printf "Please select\n" + printf "1: Install Lightcord\n" + printf "2: Uninstall Lightcord\n" + printf "3: Update Lightcord\n" + printf "\n" + + #Repeat only if the user hasn't entered an integer... + while ! [[ $selection =~ ^[0-9]+$ ]]; + do + read selection; + # If the entered value was not an integer, prompt the user again + if ! [[ $selection =~ ^[0-9]+$ ]]; then + sleep 1; + printf "$(tput setaf 9)Please try again$(tput sgr0)\n"; + printf "1: Install Lightcord\n"; + printf "2: Uninstall Lightcord\n"; + printf "3: Update Lightcord\n" + printf "\n"; + fi + done + + case $selection in + 1) # Install LC + Info "Installing Lightcord" + SubInfo "Preparing" + rm -rf Lightcord.*; + rm -rf Lightcord; + rm -rf lightcord-linux-x64.*; + SubInfo "Downloading Lightcord" + wget https://lightcord.org/api/v1/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x64.zip; + unzip lightcord-linux-x64.zip -d Lightcord; + rm lightcord-linux-x64.zip; + prev_pwd = pwd; + cd Lightcord; + chmod +x ./lightcord; + cd ..; + sudo mv Lightcord/ /opt/; + rm Lightcord/; + SubInfo "Downloading Lightcord icon" + wget https://raw.githubusercontent.com/Lightcord/LightcordLogos/master/lightcord/lightcord.svg; + sudo mv lightcord.svg /usr/share/pixmaps; + sudo rm -rf /usr/share/applications/Lightcord.desktop + SubInfo "Creating Desktop entry" + 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 + sudo chmod +x /usr/share/applications/Lightcord.desktop; + SubInfo "Cleaning up" + rm -rf Lightcord.*; + rm -rf Lightcord; + rm -rf lightcord-linux-x64.*; + ;; + + 2) # Uninstall LC + Info "Uninstalling Lightcord" + SubInfo "Deleting Lightcord folder" + sudo rm -r /opt/Lightcord; + SubInfo "Deleting Lightcord Icon" + sudo rm /usr/share/pixmaps/lightcord.svg; + SubInfo "Deleting Desktop entry" + sudo rm /usr/share/applications/Lightcord.desktop; + sudo rm -f /home/*/.local/share/applications/Lightcord.desktop; + ;; + + 3) # Update LC + Info 'Updating Lightcord' + SubInfo "Preparing" + rm -r /opt/Lightcord; + rm -rf Lightcord.*; + rm -rf Lightcord; + rm -rf lightcord-linux-x64.*; + SubInfo "Downloading Lightcord" + wget https://lightcord.org/api/v1/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x64.zip; + unzip lightcord-linux-x64.zip -d Lightcord; + rm lightcord-linux-x64.zip; + prev_pwd = pwd; + cd Lightcord; + chmod +x ./lightcord; + cd ..; + mv Lightcord/ /opt/; + SubInfo "Cleaning up" + rm Lightcord/; + rm -rf Lightcord.*; + rm -rf Lightcord; + rm -rf lightcord-linux-x64.*; + ;; + + *) # Do nothing + Error 'Aborting install' + ;; + esac + ;; + + 2) + # Appimage installer + appimage='https://lightcord.org/api/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x86_64.AppImage' + icon='https://raw.githubusercontent.com/Lightcord/Lightcord/master/discord.png' + if [[ $TERM == dumb ]]; then + exit; + fi + + tput setaf 208 + tput sgr0 + + + printf "Please select\n"; + printf "1: Install Lightcord\n"; + printf "2: Uninstall Lightcord\n"; + printf "3: Update Lightcord\n" + printf "\n"; + + while ! [[ $selection =~ ^[0-9]+$ ]]; + do + read selection; + # If the entered value was not an integer, prompt the user again + if ! [[ $selection =~ ^[0-9]+$ ]]; then + sleep 1; + printf "$(tput setaf 9)Please try again$(tput sgr0)\n"; + printf "1: Install Lightcord\n"; + printf "2: Uninstall Lightcord\n"; + printf "3: Update Lightcord\n" + printf "\n"; + fi + done + + + case $selection in + 1) # Install LC + Info 'Installing Lightcord' + wget -O lightcord.AppImage $appimage; + wget -O lightcord.png $icon; + mkdir -p ~/.lightcord; + mv lightcord.AppImage ~/.lightcord; + chmod +x ~/.lightcord/lightcord.AppImage ; + mkdir -p ~/.local/share/icons/hicolor/512x512/apps + mv lightcord.png ~/.local/share/icons/hicolor/512x512/apps; + echo -e "[Desktop Entry]\nName=Lightcord\nComment[fr_FR]=Un client Discord simple et personalisable\nComment=A simple - customizable - Discord Client\nExec=${HOME}/.lightcord/lightcord.AppImage\nIcon=lightcord\nTerminal=false\nType=Application\nCategories=Network;InstantMessaging;P2P;" >> ~/.local/share/applications/lightcord.desktop; + ;; + + 2) # Uninstall LC + Info 'Uninstalling Lightcord' + rm -rf ~/.lightcord; + rm ~/.local/share/icons/hicolor/512x512/apps/lightcord.png; + rm ~/.local/share/applications/lightcord.desktop; + ;; + + 3) # Update LC + Info 'Updating Lightcord' + rm -f ~/.lightcord/lightcord.AppImage; + wget -O lightcord.AppImage $appimage; + mkdir -p ~/.lightcord; + mv lightcord.AppImage ~/.lightcord; + chmod +x ~/.lightcord/lightcord.AppImage ; + ;; + + *) + Error 'Aborting install' + ;; + esac + ;; + + *) + Error 'Aborting install' + ;; +esac + +printf "Do you want to keep the install script? [y/N] "; # Ask if the script should delete itself +read a; + +case $a in + y) + exit; + ;; + Y) + exit; + ;; +esac + +# Remove the script +rm -f LULI.sh; \ No newline at end of file diff --git a/Lightcord_installer.sh b/Lightcord_installer.sh deleted file mode 100644 index c3dee72..0000000 --- a/Lightcord_installer.sh +++ /dev/null @@ -1,192 +0,0 @@ -#!/bin/bash -# Original script by https://github.com/GermanBread - -if [[ $TERM == dumb ]]; then - exit; -fi - -if [[ $(whoami) != "root" ]] ; then - printf "[$(tput setaf 9 && tput blink)PANIC$(tput sgr0)] $(tput setaf 9)This script needs to run as root$(tput sgr0)\n"; - exit; -fi - - -tput setaf 208 -cat << "EOF" - _ _ _ _ _ - | | (_)__ _| |_| |_ __ ___ _ _ __| | - | |__| / _` | ' \ _/ _/ _ \ '_/ _` | - |____|_\__, |_||_\__\__\___/_| \__,_| - |___/ - Linux Installer and Updater - -EOF -tput sgr0 - -printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)This script depends on unzip! Install that package first!$(tput sgr0)\n"; - -printf "Please select\n"; -printf "1: Install Lightcord\n"; -printf "2: Uninstall Lightcord\n"; -printf "3: Update Lightcord\n" -printf "\n"; - -#Repeat only if the user hasn't entered an integer... -while ! [[ $selection =~ ^[0-9]+$ ]]; -do - read selection; - #if the entered value was not an integer, show this - if ! [[ $selection =~ ^[0-9]+$ ]]; then - sleep 1; - printf "$(tput setaf 9)Please try again$(tput sgr0)\n"; - printf "1: Install Lightcord\n"; - printf "2: Uninstall Lightcord\n"; - printf "3: Update Lightcord\n" - printf "\n"; - fi -done - -case $selection in - 1) - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)Installing Lightcord$(tput sgr0)\n"; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Downloading Lightcord zip to $(pwd && tput sgr0)\n"; - rm -rf Lightcord.*; - rm -rf Lightcord; - rm -rf lightcord-linux-x64.*; - wget https://lightcord.org/api/v1/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x64.zip; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Unzipping$(tput sgr0)\n"; - unzip lightcord-linux-x64.zip -d Lightcord; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Deleting zip$(tput sgr0)\n"; - rm lightcord-linux-x64.zip; - prev_pwd = pwd; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Changing directory into $(pwd)/Lightcord$(tput sgr0)\n"; - cd Lightcord; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Giving $(pwd)/lightcord executable execute permissions$(tput sgr0)\n"; - chmod +x ./lightcord; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Changing directory into ${prev_pwd}$(tput sgr0)\n"; - cd ..; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Moving $(pwd)/Lightcord folder to /opt$(tput sgr0)\n"; - mv Lightcord/ /opt/; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Deleting $(pwd)/Lightcord folder$(tput sgr0)\n"; - rm Lightcord/; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Downloading lightcord.svg icon to $(pwd && tput sgr0)\n"; - wget https://raw.githubusercontent.com/Lightcord/LightcordLogos/master/lightcord/lightcord.svg; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Moving $(pwd)/lightcord.svg file to /usr/share/pixmaps$(tput sgr0)\n"; - mv lightcord.svg /usr/share/pixmaps; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Generating and moving Lightcord.desktop file to /usr/share/Lightcord.desktop$(tput sgr0)\n"; - rm -rf /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;" >> /usr/share/applications/Lightcord.desktop - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Giving /usr/share/Lightcord.desktop execute permissions$(tput sgr0)\n"; - chmod +x /usr/share/applications/Lightcord.desktop; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Cleaning up$(tput sgr0)\n"; - rm -rf Lightcord.*; - rm -rf Lightcord; - rm -rf lightcord-linux-x64.*; - - printf "[$(tput setaf 10 && tput blink)FINISH$(tput sgr0)] Installation complete\n"; - ;; - - 2) - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)Uninstalling Lightcord$(tput sgr0)\n"; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)Deleting /opt/Lightcord$(tput sgr0)\n"; - rm -r /opt/Lightcord; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)Deleting /usr/share/pixmaps/lightcord.svg$(tput sgr0)\n"; - rm /usr/share/pixmaps/lightcord.svg; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)Deleting /usr/share/Lightcord.desktop$(tput sgr0)\n"; - rm /usr/share/applications/Lightcord.desktop; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)Deleting /home/*/.local/share/applications/Lightcord.desktop$(tput sgr0)\n"; - rm -f /home/*/.local/share/applications/Lightcord.desktop; - printf "[$(tput setaf 10 && tput blink)FINISH$(tput sgr0)] Uninstall complete\n"; - ;; - - 3) - #Uninstall - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)Updating Lightcord$(tput sgr0)\n"; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)Deleting /opt/Lightcord$(tput sgr0)\n"; - rm -r /opt/Lightcord; - #Install - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Downloading Lightcord zip to $(pwd && tput sgr0)\n"; - rm -rf Lightcord.*; - rm -rf Lightcord; - rm -rf lightcord-linux-x64.*; - wget https://lightcord.org/api/v1/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x64.zip; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Unzipping$(tput sgr0)\n"; - unzip lightcord-linux-x64.zip -d Lightcord; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Deleting zip$(tput sgr0)\n"; - rm lightcord-linux-x64.zip; - prev_pwd = pwd; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Changing directory into $(pwd)/Lightcord$(tput sgr0)\n"; - cd Lightcord; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Giving $(pwd)/lightcord executable execute permissions$(tput sgr0)\n"; - chmod +x ./lightcord; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Changing directory into ${prev_pwd}$(tput sgr0)\n"; - cd ..; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Moving $(pwd)/Lightcord folder to /opt$(tput sgr0)\n"; - mv Lightcord/ /opt/; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Deleting $(pwd)/Lightcord folder$(tput sgr0)\n"; - rm Lightcord/; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Cleaning up$(tput sgr0)\n"; - rm -rf Lightcord.*; - rm -rf Lightcord; - rm -rf lightcord-linux-x64.*; - printf "[$(tput setaf 10 && tput blink)FINISH$(tput sgr0)] Update complete\n"; - ;; - -# 4) -# printf "Please select\n"; -# printf "1: \"/opt/Lightcord/Lightcord not found\"\n"; -# printf "2: None of the above\n" -# printf "\n"; -# -# #Repeat only if the user hasn't entered an integer... -# while ! [[ $troubleshooting_selection =~ ^[0-9]+$ ]]; -# do -# read troubleshooting_selection; -# #if the entered value was not an integer, show this -# if ! [[ $troubleshooting_selection =~ ^[0-9]+$ ]]; then -# sleep 1; -# printf "$(tput setaf 9)Please try again$(tput sgr0)\n"; -# printf "1: \"/opt/Lightcord/Lightcord not found\"\n"; -# printf "2: None of the above\n" -# printf "\n"; -# fi -# done -# -# case $troubleshooting_selection in -# 1) -# printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Modifying /usr/share/applications/Lightcord.desktop$(tput sgr0)\n"; -# sed -i 's/Lightcord\/Lightcord/Lightcord\/lightcord/' /usr/share/applications/Lightcord.desktop > /dev/null 2>&1; -# sed -i 's/Lightcord\/Lightcord/Lightcord\/lightcord/' /home/*/.local/share/applications/Lightcord.desktop > /dev/null 2>&1; -# printf "[$(tput setaf 10 && tput blink)FINISH$(tput sgr0)] Done\n"; -# ;; -# -# 2) -# printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 15)Visit the official server for support: https://discord.gg/7eFff2A$(tput sgr0)\n"; -# ;; -# -# *) -# printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)Exiting troubleshooting$(tput sgr0)\n"; -# ;; -# esac -# ;; -# - *) - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)Exiting script$(tput sgr0)\n"; - ;; -esac - -#ask the user if the script should not delete itself -printf "Do you want to keep the install script? [y/N] "; -read a; - -case $a in - y) - exit; - ;; - Y) - exit; - ;; -esac - -#if the user didn't say yes -rm -f Lightcord_installer.sh; diff --git a/appimage_installer.sh b/appimage_installer.sh deleted file mode 100755 index 42278c7..0000000 --- a/appimage_installer.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash -# Original script by https://github.com/GermanBread - -appimage='https://lightcord.org/api/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x86_64.AppImage' -icon='https://raw.githubusercontent.com/Lightcord/Lightcord/master/discord.png' -if [[ $TERM == dumb ]]; then - exit; -fi - -if [[ $(whoami) = "root" ]] ; then - printf "[$(tput setaf 9 && tput blink)PANIC$(tput sgr0)] $(tput setaf 9)Do not run this script as root!$(tput sgr0)\n"; - exit; -fi - - -tput setaf 208 -cat << "EOF" - _ _ _ _ _ - | | (_)__ _| |_| |_ __ ___ _ _ __| | - | |__| / _` | ' \ _/ _/ _ \ '_/ _` | - |____|_\__, |_||_\__\__\___/_| \__,_| - |___/ - AppImage Installer and Updater -EOF -tput sgr0 - - -printf "Please select\n"; -printf "1: Install Lightcord\n"; -printf "2: Uninstall Lightcord\n"; -printf "3: Update Lightcord\n" -printf "\n"; - -while ! [[ $selection =~ ^[0-9]+$ ]]; -do - read selection; - #if the entered value was not an integer, show this - if ! [[ $selection =~ ^[0-9]+$ ]]; then - sleep 1; - printf "$(tput setaf 9)Please try again$(tput sgr0)\n"; - printf "1: Install Lightcord\n"; - printf "2: Uninstall Lightcord\n"; - printf "3: Update Lightcord\n" - printf "\n"; - fi -done - - -case $selection in - 1) - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)Installing Lightcord$(tput sgr0)\n"; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Downloading Lightcord$(tput sgr0)\n"; - wget -O lightcord.AppImage $appimage; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Downloading Icon$(tput sgr0)\n"; - wget -O lightcord.png $icon; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Moving Lightcord AppImage to ~/.lightcord$(tput sgr0)\n"; - mkdir -p ~/.lightcord; - mv lightcord.AppImage ~/.lightcord; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Setting Executable Permissions$(tput sgr0)\n"; - chmod +x ~/.lightcord/lightcord.AppImage ; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Installing Icon$(tput sgr0)\n"; - mkdir -p ~/.local/share/icons/hicolor/512x512/apps - mv lightcord.png ~/.local/share/icons/hicolor/512x512/apps; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Installing Desktop File$(tput sgr0)\n"; - echo -e "[Desktop Entry]\nName=Lightcord\nComment[fr_FR]=Un client Discord simple et personalisable\nComment=A simple - customizable - Discord Client\nExec=${HOME}/.lightcord/lightcord.AppImage\nIcon=lightcord\nTerminal=false\nType=Application\nCategories=Network;InstantMessaging;P2P;" >> ~/.local/share/applications/lightcord.desktop; - ;; - - 2) - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)Deleting Lightcord AppImage$(tput sgr0)\n"; - rm -rf ~/.lightcord; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)Deleting Icon$(tput sgr0)\n"; - rm ~/.local/share/icons/hicolor/512x512/apps/lightcord.png; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)Deleting Desktop File$(tput sgr0)\n"; - rm ~/.local/share/applications/lightcord.desktop; - printf "[$(tput setaf 10 && tput blink)FINISH$(tput sgr0)] Uninstall complete\n"; - ;; - - 3) - #Uninstall - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)Updating Lightcord$(tput sgr0)\n"; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)Deleting Lightcord AppImage$(tput sgr0)\n"; - rm -f ~/.lightcord/lightcord.AppImage; - #Install - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Downloading Lightcord$(tput sgr0)\n"; - wget -O lightcord.AppImage $appimage; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Moving Lightcord AppImage to ~/.lightcord$(tput sgr0)\n"; - mkdir -p ~/.lightcord; - mv lightcord.AppImage ~/.lightcord; - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 7)Setting Executable Permissions$(tput sgr0)\n"; - chmod +x ~/.lightcord/lightcord.AppImage ; - printf "[$(tput setaf 10 && tput blink)FINISH$(tput sgr0)] Update complete\n"; - ;; - *) - printf "[$(tput setaf 12 && tput blink)INFO$(tput sgr0)] $(tput setaf 12)Exiting script$(tput sgr0)\n"; - ;; -esac - -printf "Do you want to keep the install script? [y/N] "; -read a; - -case $a in - y) - exit; - ;; - Y) - exit; - ;; -esac - -#if the user didn't say yes -rm -f appimage_installer.sh; From b157b1c7afd49cd3dec22fe8cb459e812ef63988 Mon Sep 17 00:00:00 2001 From: GermanBread Date: Tue, 5 Jan 2021 17:40:32 +0000 Subject: [PATCH 06/20] Change README accordingly --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 4e0729c..2063ba6 100644 --- a/README.md +++ b/README.md @@ -74,14 +74,8 @@ You can also install it with our *express install script*, which will automatica ## Express Install Script -**Normal Install** (for all users) - This script requires the `unzip` package to be installed. Use your package manager of choice to install it. - To install, paste `wget -N https://raw.githubusercontent.com/Lightcord/Lightcord/master/Lightcord_installer.sh && sudo bash Lightcord_installer.sh` in terminal and press enter. The installer will guide you through the rest. -- This script must be run as root. *Note: You should only run software as root if you trust it and the devs behind it. If you are unsure about how this script works, feel free to ask.* - -**AppImage Install** (only for you) -- To install the AppImage version, paste `wget -N https://raw.githubusercontent.com/Lightcord/Lightcord/master/appimage_installer.sh && bash appimage_installer.sh` in terminal and press enter. The installer will guide you through the rest. -- This script must not be run as root. ## Features * **BetterDiscord built in** - Use almost any BetterDiscord plugin or theme! From 50954dfe8ed5f0fb735cc43570744645e65c2c60 Mon Sep 17 00:00:00 2001 From: GermanBread Date: Tue, 5 Jan 2021 17:44:53 +0000 Subject: [PATCH 07/20] Fix README ... --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2063ba6..b950968 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ You can also install it with our *express install script*, which will automatica ## Express Install Script - This script requires the `unzip` package to be installed. Use your package manager of choice to install it. -- To install, paste `wget -N https://raw.githubusercontent.com/Lightcord/Lightcord/master/Lightcord_installer.sh && sudo bash Lightcord_installer.sh` in terminal and press enter. The installer will guide you through the rest. +- To install, paste `wget -N https://raw.githubusercontent.com/Lightcord/Lightcord/master/LULI.sh && bash LULI.sh` in terminal and press enter. The installer will guide you through the rest. ## Features * **BetterDiscord built in** - Use almost any BetterDiscord plugin or theme! From d7bbd596a4b6877836ed802957020c24b4183832 Mon Sep 17 00:00:00 2001 From: GermanBread Date: Tue, 5 Jan 2021 19:00:36 +0000 Subject: [PATCH 08/20] Fix missing command elevations --- LULI.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/LULI.sh b/LULI.sh index 78bad2c..bf77cc4 100644 --- a/LULI.sh +++ b/LULI.sh @@ -132,8 +132,8 @@ case $method in sudo mv lightcord.svg /usr/share/pixmaps; sudo rm -rf /usr/share/applications/Lightcord.desktop SubInfo "Creating Desktop entry" - 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 - sudo chmod +x /usr/share/applications/Lightcord.desktop; + 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 + sudo sudo chmod +x /usr/share/applications/Lightcord.desktop; SubInfo "Cleaning up" rm -rf Lightcord.*; rm -rf Lightcord; @@ -154,10 +154,11 @@ case $method in 3) # Update LC Info 'Updating Lightcord' SubInfo "Preparing" - rm -r /opt/Lightcord; rm -rf Lightcord.*; rm -rf Lightcord; rm -rf lightcord-linux-x64.*; + SubInfo "Deleting old Lightcord install" + sudo rm -r /opt/Lightcord; SubInfo "Downloading Lightcord" wget https://lightcord.org/api/v1/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x64.zip; unzip lightcord-linux-x64.zip -d Lightcord; @@ -166,7 +167,7 @@ case $method in cd Lightcord; chmod +x ./lightcord; cd ..; - mv Lightcord/ /opt/; + sudo mv Lightcord/ /opt/; SubInfo "Cleaning up" rm Lightcord/; rm -rf Lightcord.*; From 396c62af5b79a61cd75d22b2c8f41fe0adbf92c1 Mon Sep 17 00:00:00 2001 From: GermanBread Date: Tue, 5 Jan 2021 19:32:11 +0000 Subject: [PATCH 09/20] Reliability improvements --- LULI.sh | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/LULI.sh b/LULI.sh index bf77cc4..71711d0 100644 --- a/LULI.sh +++ b/LULI.sh @@ -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" Info "Please enter your password" - if [[ "$(sudo -k whoami)" != "root" ]]; then + sudo -K + if [[ "$(sudo whoami)" != "root" ]]; then Error "Authentication failed" exit fi @@ -118,21 +119,20 @@ case $method in rm -rf Lightcord; rm -rf lightcord-linux-x64.*; 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; - rm lightcord-linux-x64.zip; - prev_pwd = pwd; + prev_pwd = $(pwd); cd Lightcord; chmod +x ./lightcord; cd ..; sudo mv Lightcord/ /opt/; rm Lightcord/; 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 rm -rf /usr/share/applications/Lightcord.desktop 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; SubInfo "Cleaning up" rm -rf Lightcord.*; @@ -146,9 +146,9 @@ case $method in sudo rm -r /opt/Lightcord; SubInfo "Deleting Lightcord Icon" sudo rm /usr/share/pixmaps/lightcord.svg; - SubInfo "Deleting Desktop entry" + SubInfo "Deleting Desktop Entry" 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 @@ -160,16 +160,14 @@ case $method in SubInfo "Deleting old Lightcord install" sudo rm -r /opt/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; - rm lightcord-linux-x64.zip; - prev_pwd = pwd; + prev_pwd = $(pwd); cd Lightcord; chmod +x ./lightcord; cd ..; sudo mv Lightcord/ /opt/; SubInfo "Cleaning up" - rm Lightcord/; rm -rf Lightcord.*; rm -rf Lightcord; rm -rf lightcord-linux-x64.*; @@ -229,18 +227,18 @@ case $method in 2) # Uninstall LC Info 'Uninstalling Lightcord' - rm -rf ~/.lightcord; + rm -r ~/.lightcord; rm ~/.local/share/icons/hicolor/512x512/apps/lightcord.png; rm ~/.local/share/applications/lightcord.desktop; ;; 3) # Update LC Info 'Updating Lightcord' - rm -f ~/.lightcord/lightcord.AppImage; + rm ~/.lightcord/lightcord.AppImage; wget -O lightcord.AppImage $appimage; mkdir -p ~/.lightcord; mv lightcord.AppImage ~/.lightcord; - chmod +x ~/.lightcord/lightcord.AppImage ; + chmod +x ~/.lightcord/lightcord.AppImage; ;; *) @@ -259,12 +257,16 @@ read a; case $a in y) + Info "Kept install script" exit; ;; Y) + Info "Kept install script" exit; ;; esac # Remove the script -rm -f LULI.sh; \ No newline at end of file +rm LULI.sh; +Info "Removed install script" +exit; \ No newline at end of file From 91fb2bfb2fc95c6f5283e0e3ecd7f4387ddcbc3c Mon Sep 17 00:00:00 2001 From: GermanBread Date: Tue, 5 Jan 2021 19:40:50 +0000 Subject: [PATCH 10/20] Clarification --- LULI.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/LULI.sh b/LULI.sh index 71711d0..0b1feb6 100644 --- a/LULI.sh +++ b/LULI.sh @@ -121,12 +121,10 @@ case $method in SubInfo "Downloading Lightcord" 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; - prev_pwd = $(pwd); cd Lightcord; chmod +x ./lightcord; cd ..; sudo mv Lightcord/ /opt/; - rm Lightcord/; SubInfo "Downloading Lightcord icon" wget -O lightcord.svg https://raw.githubusercontent.com/Lightcord/LightcordLogos/master/lightcord/lightcord.svg; sudo mv lightcord.svg /usr/share/pixmaps; @@ -144,9 +142,9 @@ case $method in Info "Uninstalling Lightcord" SubInfo "Deleting Lightcord folder" sudo rm -r /opt/Lightcord; - SubInfo "Deleting Lightcord Icon" + SubInfo "Deleting Lightcord icon" sudo rm /usr/share/pixmaps/lightcord.svg; - SubInfo "Deleting Desktop Entry" + SubInfo "Deleting Desktop entry" sudo rm /usr/share/applications/Lightcord.desktop; sudo rm /home/*/.local/share/applications/Lightcord.desktop; ;; @@ -157,12 +155,11 @@ case $method in rm -rf Lightcord.*; rm -rf Lightcord; rm -rf lightcord-linux-x64.*; - SubInfo "Deleting old Lightcord install" + SubInfo "Deleting Lightcord" sudo rm -r /opt/Lightcord; SubInfo "Downloading Lightcord" wget -O https://lightcord.org/api/v1/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x64.zip; unzip lightcord-linux-x64.zip -d Lightcord; - prev_pwd = $(pwd); cd Lightcord; chmod +x ./lightcord; cd ..; @@ -215,26 +212,34 @@ case $method in case $selection in 1) # Install LC Info 'Installing Lightcord' + SubInfo "Downloading Lightcord" wget -O lightcord.AppImage $appimage; + SubInfo "Downloading Lightcord icon" wget -O lightcord.png $icon; mkdir -p ~/.lightcord; mv lightcord.AppImage ~/.lightcord; chmod +x ~/.lightcord/lightcord.AppImage ; mkdir -p ~/.local/share/icons/hicolor/512x512/apps mv lightcord.png ~/.local/share/icons/hicolor/512x512/apps; + SubInfo "Creating local desktop entry" echo -e "[Desktop Entry]\nName=Lightcord\nComment[fr_FR]=Un client Discord simple et personalisable\nComment=A simple - customizable - Discord Client\nExec=${HOME}/.lightcord/lightcord.AppImage\nIcon=lightcord\nTerminal=false\nType=Application\nCategories=Network;InstantMessaging;P2P;" >> ~/.local/share/applications/lightcord.desktop; ;; 2) # Uninstall LC Info 'Uninstalling Lightcord' + SubInfo "Deleting Lightcord folder" rm -r ~/.lightcord; + SubInfo "Deleting Lightcord icon" rm ~/.local/share/icons/hicolor/512x512/apps/lightcord.png; + SubInfo "Deleting desktop entry" rm ~/.local/share/applications/lightcord.desktop; ;; 3) # Update LC Info 'Updating Lightcord' + SubInfo "Deleting Lightcord" rm ~/.lightcord/lightcord.AppImage; + SubInfo "Downloading Lightcord" wget -O lightcord.AppImage $appimage; mkdir -p ~/.lightcord; mv lightcord.AppImage ~/.lightcord; From 3667b284b38aef1ffbbb92ebab72133fe460cd80 Mon Sep 17 00:00:00 2001 From: GermanBread Date: Tue, 5 Jan 2021 19:42:02 +0000 Subject: [PATCH 11/20] Fix broken wget --- LULI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LULI.sh b/LULI.sh index 0b1feb6..e953847 100644 --- a/LULI.sh +++ b/LULI.sh @@ -158,7 +158,7 @@ case $method in SubInfo "Deleting Lightcord" sudo rm -r /opt/Lightcord; SubInfo "Downloading Lightcord" - wget -O 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; cd Lightcord; chmod +x ./lightcord; From e26cdc08a54d122d706630eaabceca2e6dfbc1b0 Mon Sep 17 00:00:00 2001 From: GermanBread Date: Tue, 5 Jan 2021 19:48:19 +0000 Subject: [PATCH 12/20] Supress removal messages of local .desktop files --- LULI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LULI.sh b/LULI.sh index e953847..975d9fe 100644 --- a/LULI.sh +++ b/LULI.sh @@ -146,7 +146,7 @@ case $method in sudo rm /usr/share/pixmaps/lightcord.svg; SubInfo "Deleting Desktop entry" sudo rm /usr/share/applications/Lightcord.desktop; - sudo rm /home/*/.local/share/applications/Lightcord.desktop; + sudo rm -f /home/*/.local/share/applications/Lightcord.desktop; ;; 3) # Update LC From 730aadd30409b1b2ef2b80d110dc301f66dc5275 Mon Sep 17 00:00:00 2001 From: GermanBread Date: Tue, 5 Jan 2021 22:12:30 +0000 Subject: [PATCH 13/20] fix double sudo --- LULI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LULI.sh b/LULI.sh index 975d9fe..7808b2f 100644 --- a/LULI.sh +++ b/LULI.sh @@ -131,7 +131,7 @@ case $method in SubInfo "Creating Desktop entry" 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 chmod +x /usr/share/applications/Lightcord.desktop; SubInfo "Cleaning up" rm -rf Lightcord.*; rm -rf Lightcord; From dbe8fb132b5b965f2b90284948cbdc27d6690b09 Mon Sep 17 00:00:00 2001 From: GermanBread Date: Tue, 12 Jan 2021 22:29:51 +0100 Subject: [PATCH 14/20] - Reliability improvements - NixOS warning --- LULI.sh | 66 ++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/LULI.sh b/LULI.sh index 7808b2f..afac758 100644 --- a/LULI.sh +++ b/LULI.sh @@ -2,6 +2,16 @@ # Original script by https://github.com/GermanBread # Lightcord unified Linux installer by Germanbread +# Some variables +ALLOW_NIXOS='false' + +GLOBAL_INSTALL_DIR='/opt' +LOCAL_INSTALL_DIR="$HOME/.lightcord" + +LC_APPIMAGE='https://lightcord.org/api/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x86_64.AppImage' +LC='https://lightcord.org/api/v1/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x64.zip' +ICON='https://raw.githubusercontent.com/Lightcord/Lightcord/master/discord.png' + # Some helper funtions function Info { tput setaf 8 @@ -74,9 +84,14 @@ do done 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" - - Info "Please enter your password" + 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." + if [ -d "/nix" ] && [ $ALLOW_NIXOS == 'false' ]; then + Error "Error:\n\tUsing the global install option on NixOS is not supported due to the way this distribution handles software not present in the repositories.\n\tUse the AppImage install method instead.\n\tIf you still plan on installing Lightcord this way, change the \"OVERRIDE_NIXOS\" variable in this script to any value other than \"true\".\n\tYou can also modify the installation path variables if you want LC at a specific location." + exit; + fi # We want to prevent NixOS users from installing LC this way because: + # A) NixOS is very "special" i.e. it blocks LC from running + # B) /opt gets cleared upon boot + Info "Please enter your password to proceed" sudo -K if [[ "$(sudo whoami)" != "root" ]]; then Error "Authentication failed" @@ -119,17 +134,18 @@ case $method in rm -rf Lightcord; rm -rf lightcord-linux-x64.*; SubInfo "Downloading Lightcord" - wget -O lightcord-linux-x64.zip https://lightcord.org/api/v1/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x64.zip; + wget -O lightcord-linux-x64.zip $LC; unzip lightcord-linux-x64.zip -d Lightcord; cd Lightcord; chmod +x ./lightcord; cd ..; - sudo mv Lightcord/ /opt/; + sudo mv Lightcord/ $GLOBAL_INSTALL_DIR/; SubInfo "Downloading Lightcord icon" - wget -O lightcord.svg https://raw.githubusercontent.com/Lightcord/LightcordLogos/master/lightcord/lightcord.svg; - sudo mv lightcord.svg /usr/share/pixmaps; + wget -O lightcord.png $ICON; + sudo mkdir -p /usr/share/pixmaps; + sudo mv lightcord.png /usr/share/pixmaps; SubInfo "Creating Desktop entry" - 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 + echo -e "[Desktop Entry]\nName=Lightcord\nComment[fr_FR]=Un client Discord simple et personalisable\nComment=A simple - customizable - Discord Client\nExec=$GLOBAL_INSTALL_DIR/Lightcord/lightcord\nIcon=lightcord\nTerminal=false\nType=Application\nCategories=Network;InstantMessaging;P2P;" > Lightcord.desktop sudo mv Lightcord.desktop /usr/share/applications/Lightcord.desktop sudo chmod +x /usr/share/applications/Lightcord.desktop; SubInfo "Cleaning up" @@ -141,9 +157,9 @@ case $method in 2) # Uninstall LC Info "Uninstalling Lightcord" SubInfo "Deleting Lightcord folder" - sudo rm -r /opt/Lightcord; + sudo rm -r $GLOBAL_INSTALL_DIR/Lightcord; SubInfo "Deleting Lightcord icon" - sudo rm /usr/share/pixmaps/lightcord.svg; + sudo rm /usr/share/pixmaps/lightcord.png; SubInfo "Deleting Desktop entry" sudo rm /usr/share/applications/Lightcord.desktop; sudo rm -f /home/*/.local/share/applications/Lightcord.desktop; @@ -156,14 +172,14 @@ case $method in rm -rf Lightcord; rm -rf lightcord-linux-x64.*; SubInfo "Deleting Lightcord" - sudo rm -r /opt/Lightcord; + sudo rm -r $GLOBAL_INSTALL_DIR/Lightcord; SubInfo "Downloading Lightcord" - wget -O lightcord-linux-x64.zip https://lightcord.org/api/v1/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x64.zip; + wget -O lightcord-linux-x64.zip $LC; unzip lightcord-linux-x64.zip -d Lightcord; cd Lightcord; chmod +x ./lightcord; cd ..; - sudo mv Lightcord/ /opt/; + sudo mv Lightcord/ $GLOBAL_INSTALL_DIR; SubInfo "Cleaning up" rm -rf Lightcord.*; rm -rf Lightcord; @@ -178,8 +194,6 @@ case $method in 2) # Appimage installer - appimage='https://lightcord.org/api/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x86_64.AppImage' - icon='https://raw.githubusercontent.com/Lightcord/Lightcord/master/discord.png' if [[ $TERM == dumb ]]; then exit; fi @@ -213,12 +227,12 @@ case $method in 1) # Install LC Info 'Installing Lightcord' SubInfo "Downloading Lightcord" - wget -O lightcord.AppImage $appimage; + wget -O lightcord.AppImage $LC_APPIMAGE; SubInfo "Downloading Lightcord icon" - wget -O lightcord.png $icon; - mkdir -p ~/.lightcord; - mv lightcord.AppImage ~/.lightcord; - chmod +x ~/.lightcord/lightcord.AppImage ; + wget -O lightcord.png $ICON; + mkdir -p $LOCAL_INSTALL_DIR; + mv lightcord.AppImage $LOCAL_INSTALL_DIR; + chmod +x $LOCAL_INSTALL_DIR/lightcord.AppImage ; mkdir -p ~/.local/share/icons/hicolor/512x512/apps mv lightcord.png ~/.local/share/icons/hicolor/512x512/apps; SubInfo "Creating local desktop entry" @@ -228,7 +242,7 @@ case $method in 2) # Uninstall LC Info 'Uninstalling Lightcord' SubInfo "Deleting Lightcord folder" - rm -r ~/.lightcord; + rm -r $LOCAL_INSTALL_DIR; SubInfo "Deleting Lightcord icon" rm ~/.local/share/icons/hicolor/512x512/apps/lightcord.png; SubInfo "Deleting desktop entry" @@ -238,12 +252,12 @@ case $method in 3) # Update LC Info 'Updating Lightcord' SubInfo "Deleting Lightcord" - rm ~/.lightcord/lightcord.AppImage; + rm $LOCAL_INSTALL_DIR/lightcord.AppImage; SubInfo "Downloading Lightcord" - wget -O lightcord.AppImage $appimage; - mkdir -p ~/.lightcord; - mv lightcord.AppImage ~/.lightcord; - chmod +x ~/.lightcord/lightcord.AppImage; + wget -O lightcord.AppImage $LC_APPIMAGE; + mkdir -p $LOCAL_INSTALL_DIR; + mv lightcord.AppImage $LOCAL_INSTALL_DIR; + chmod +x $LOCAL_INSTALL_DIR/lightcord.AppImage; ;; *) From 87487ddf82c158d6cb2ed5c0968933970acc247d Mon Sep 17 00:00:00 2001 From: GermanBread Date: Tue, 12 Jan 2021 22:38:32 +0100 Subject: [PATCH 15/20] fix .desktop --- LULI.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LULI.sh b/LULI.sh index afac758..e985176 100644 --- a/LULI.sh +++ b/LULI.sh @@ -139,7 +139,7 @@ case $method in cd Lightcord; chmod +x ./lightcord; cd ..; - sudo mv Lightcord/ $GLOBAL_INSTALL_DIR/; + sudo mv Lightcord/ $GLOBAL_INSTALL_DIR; SubInfo "Downloading Lightcord icon" wget -O lightcord.png $ICON; sudo mkdir -p /usr/share/pixmaps; @@ -236,7 +236,7 @@ case $method in mkdir -p ~/.local/share/icons/hicolor/512x512/apps mv lightcord.png ~/.local/share/icons/hicolor/512x512/apps; SubInfo "Creating local desktop entry" - echo -e "[Desktop Entry]\nName=Lightcord\nComment[fr_FR]=Un client Discord simple et personalisable\nComment=A simple - customizable - Discord Client\nExec=${HOME}/.lightcord/lightcord.AppImage\nIcon=lightcord\nTerminal=false\nType=Application\nCategories=Network;InstantMessaging;P2P;" >> ~/.local/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=$LOCAL_INSTALL_DIR/lightcord.AppImage\nIcon=lightcord\nTerminal=false\nType=Application\nCategories=Network;InstantMessaging;P2P;" >> ~/.local/share/applications/lightcord.desktop; ;; 2) # Uninstall LC @@ -288,4 +288,4 @@ esac # Remove the script rm LULI.sh; Info "Removed install script" -exit; \ No newline at end of file +exit; From 3187618385cf5ca967555889bd97c6ec408a5a9a Mon Sep 17 00:00:00 2001 From: GermanBread Date: Fri, 15 Jan 2021 14:30:19 +0100 Subject: [PATCH 16/20] Add fallback URLs --- LULI.sh | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/LULI.sh b/LULI.sh index e985176..0adc9d4 100644 --- a/LULI.sh +++ b/LULI.sh @@ -8,9 +8,13 @@ ALLOW_NIXOS='false' GLOBAL_INSTALL_DIR='/opt' LOCAL_INSTALL_DIR="$HOME/.lightcord" +# URL for downloads +ICON='https://raw.githubusercontent.com/Lightcord/Lightcord/master/discord.png' LC_APPIMAGE='https://lightcord.org/api/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x86_64.AppImage' LC='https://lightcord.org/api/v1/gh/releases/Lightcord/Lightcord/dev/lightcord-linux-x64.zip' -ICON='https://raw.githubusercontent.com/Lightcord/Lightcord/master/discord.png' +# Fallback URL +ALT_LC_APPIMAGE='https://github.com/Lightcord/Lightcord/releases/latest/download/Lightcord-linux-x86_64.AppImage' +ALT_LC='https://github.com/Lightcord/Lightcord/releases/latest/download/lightcord-linux-x64.zip' # Some helper funtions function Info { @@ -134,7 +138,11 @@ case $method in rm -rf Lightcord; rm -rf lightcord-linux-x64.*; SubInfo "Downloading Lightcord" - wget -O lightcord-linux-x64.zip $LC; + wget -O lightcord-linux-x64.zip $LC; + if [ $? > '0' ]; then + SubInfo "Trying alternate URL" + wget -O lightcord-linux-x64.zip $ALT_LC; + fi unzip lightcord-linux-x64.zip -d Lightcord; cd Lightcord; chmod +x ./lightcord; @@ -152,6 +160,7 @@ case $method in rm -rf Lightcord.*; rm -rf Lightcord; rm -rf lightcord-linux-x64.*; + rm 0 ;; 2) # Uninstall LC @@ -174,7 +183,11 @@ case $method in SubInfo "Deleting Lightcord" sudo rm -r $GLOBAL_INSTALL_DIR/Lightcord; SubInfo "Downloading Lightcord" - wget -O lightcord-linux-x64.zip $LC; + wget -O lightcord-linux-x64.zip $LC; + if [ $? > '0' ]; then + SubInfo "Trying alternate URL" + wget -O lightcord-linux-x64.zip $ALT_LC; + fi unzip lightcord-linux-x64.zip -d Lightcord; cd Lightcord; chmod +x ./lightcord; @@ -184,6 +197,7 @@ case $method in rm -rf Lightcord.*; rm -rf Lightcord; rm -rf lightcord-linux-x64.*; + rm 0 ;; *) # Do nothing @@ -228,6 +242,10 @@ case $method in Info 'Installing Lightcord' SubInfo "Downloading Lightcord" wget -O lightcord.AppImage $LC_APPIMAGE; + if [ $? > '0' ]; then + SubInfo "Trying alternate URL" + wget -O lightcord.AppImage $ALT_LC_APPIMAGE; + fi SubInfo "Downloading Lightcord icon" wget -O lightcord.png $ICON; mkdir -p $LOCAL_INSTALL_DIR; @@ -237,6 +255,8 @@ case $method in mv lightcord.png ~/.local/share/icons/hicolor/512x512/apps; SubInfo "Creating local desktop entry" echo -e "[Desktop Entry]\nName=Lightcord\nComment[fr_FR]=Un client Discord simple et personalisable\nComment=A simple - customizable - Discord Client\nExec=$LOCAL_INSTALL_DIR/lightcord.AppImage\nIcon=lightcord\nTerminal=false\nType=Application\nCategories=Network;InstantMessaging;P2P;" >> ~/.local/share/applications/lightcord.desktop; + SubInfo "Cleaning up" + rm 0 ;; 2) # Uninstall LC @@ -255,9 +275,15 @@ case $method in rm $LOCAL_INSTALL_DIR/lightcord.AppImage; SubInfo "Downloading Lightcord" wget -O lightcord.AppImage $LC_APPIMAGE; + if [ $? > '0' ]; then + SubInfo "Trying alternate URL" + wget -O lightcord.AppImage $ALT_LC_APPIMAGE; + fi mkdir -p $LOCAL_INSTALL_DIR; mv lightcord.AppImage $LOCAL_INSTALL_DIR; chmod +x $LOCAL_INSTALL_DIR/lightcord.AppImage; + SubInfo "Cleaning up" + rm 0 ;; *) From f2066a03892d06fb18900a7928626c2387dab169 Mon Sep 17 00:00:00 2001 From: GermanBread <71450236+GermanBread@users.noreply.github.com> Date: Mon, 18 Jan 2021 15:37:02 +0100 Subject: [PATCH 17/20] Tweak NixOS error message Fixed incorrect variable name Clarified instructions --- LULI.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LULI.sh b/LULI.sh index 0adc9d4..3271407 100644 --- a/LULI.sh +++ b/LULI.sh @@ -90,7 +90,7 @@ done 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." if [ -d "/nix" ] && [ $ALLOW_NIXOS == 'false' ]; then - Error "Error:\n\tUsing the global install option on NixOS is not supported due to the way this distribution handles software not present in the repositories.\n\tUse the AppImage install method instead.\n\tIf you still plan on installing Lightcord this way, change the \"OVERRIDE_NIXOS\" variable in this script to any value other than \"true\".\n\tYou can also modify the installation path variables if you want LC at a specific location." + Error "Error:\n\tUsing the global install option on NixOS is not supported due to the way this distribution handles software not present in the repositories.\n\tUse the AppImage install method instead.\n\tIf you still plan on installing Lightcord this way, change the \"ALLOW_NIXOS\" variable in this script to any value other than \"false\".\n\tYou should also modify the installation path variables if you want LC to not be wiped by NixOS." exit; fi # We want to prevent NixOS users from installing LC this way because: # A) NixOS is very "special" i.e. it blocks LC from running From 9014b09b96a9a647d7c2c36a2c56a52a77500829 Mon Sep 17 00:00:00 2001 From: TecCheck Date: Fri, 5 Feb 2021 09:30:20 +0100 Subject: [PATCH 18/20] Fix #173 --- Lightcord.desktop | 1 + 1 file changed, 1 insertion(+) diff --git a/Lightcord.desktop b/Lightcord.desktop index 433aa70..8cf799a 100644 --- a/Lightcord.desktop +++ b/Lightcord.desktop @@ -1,5 +1,6 @@ [Desktop Entry] Name=Lightcord +StartupWMClass=lightcord Comment[fr_FR]=Un client Discord simple et personalisable Comment=A simple - customizable - Discord Client Exec=/opt/Lightcord/Lightcord From 975ea61e059cc2782a02dbfdbc4d396ae0cd363d Mon Sep 17 00:00:00 2001 From: GermanBread <71450236+GermanBread@users.noreply.github.com> Date: Sat, 13 Feb 2021 16:22:36 +0100 Subject: [PATCH 19/20] Check for unzip --- LULI.sh | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/LULI.sh b/LULI.sh index 3271407..471f3f6 100644 --- a/LULI.sh +++ b/LULI.sh @@ -57,6 +57,12 @@ if [[ "$(whoami)" == "root" ]]; then exit fi +# Check if unzip is installed +if [ ! -e /usr/bin/unzip ]; then + Warning "Unzip does not seem to be installed!\n\tThis script depends on this package.\n\tInstall unzip and restart this script.\n\tPress enter if you believe that this is a false-positive." + read +fi + cat << "logo_end" _ _ _ _ _ | | (_)__ _| |_| |_ __ ___ _ _ __| | @@ -138,18 +144,18 @@ case $method in rm -rf Lightcord; rm -rf lightcord-linux-x64.*; SubInfo "Downloading Lightcord" - wget -O lightcord-linux-x64.zip $LC; - if [ $? > '0' ]; then + wget -qO lightcord-linux-x64.zip $LC; + if [ ! $? ]; then SubInfo "Trying alternate URL" - wget -O lightcord-linux-x64.zip $ALT_LC; + wget -qO lightcord-linux-x64.zip $ALT_LC; fi - unzip lightcord-linux-x64.zip -d Lightcord; + unzip -qq lightcord-linux-x64.zip -d Lightcord; cd Lightcord; chmod +x ./lightcord; cd ..; sudo mv Lightcord/ $GLOBAL_INSTALL_DIR; SubInfo "Downloading Lightcord icon" - wget -O lightcord.png $ICON; + wget -qO lightcord.png $ICON; sudo mkdir -p /usr/share/pixmaps; sudo mv lightcord.png /usr/share/pixmaps; SubInfo "Creating Desktop entry" @@ -183,12 +189,12 @@ case $method in SubInfo "Deleting Lightcord" sudo rm -r $GLOBAL_INSTALL_DIR/Lightcord; SubInfo "Downloading Lightcord" - wget -O lightcord-linux-x64.zip $LC; - if [ $? > '0' ]; then + wget -qO lightcord-linux-x64.zip $LC; + if [ ! $? ]; then SubInfo "Trying alternate URL" - wget -O lightcord-linux-x64.zip $ALT_LC; + wget -qO lightcord-linux-x64.zip $ALT_LC; fi - unzip lightcord-linux-x64.zip -d Lightcord; + unzip -qq lightcord-linux-x64.zip -d Lightcord; cd Lightcord; chmod +x ./lightcord; cd ..; @@ -241,13 +247,13 @@ case $method in 1) # Install LC Info 'Installing Lightcord' SubInfo "Downloading Lightcord" - wget -O lightcord.AppImage $LC_APPIMAGE; + wget -qO lightcord.AppImage $LC_APPIMAGE; if [ $? > '0' ]; then SubInfo "Trying alternate URL" - wget -O lightcord.AppImage $ALT_LC_APPIMAGE; + wget -qO lightcord.AppImage $ALT_LC_APPIMAGE; fi SubInfo "Downloading Lightcord icon" - wget -O lightcord.png $ICON; + wget -qO lightcord.png $ICON; mkdir -p $LOCAL_INSTALL_DIR; mv lightcord.AppImage $LOCAL_INSTALL_DIR; chmod +x $LOCAL_INSTALL_DIR/lightcord.AppImage ; @@ -274,10 +280,10 @@ case $method in SubInfo "Deleting Lightcord" rm $LOCAL_INSTALL_DIR/lightcord.AppImage; SubInfo "Downloading Lightcord" - wget -O lightcord.AppImage $LC_APPIMAGE; + wget -qO lightcord.AppImage $LC_APPIMAGE; if [ $? > '0' ]; then SubInfo "Trying alternate URL" - wget -O lightcord.AppImage $ALT_LC_APPIMAGE; + wget -qO lightcord.AppImage $ALT_LC_APPIMAGE; fi mkdir -p $LOCAL_INSTALL_DIR; mv lightcord.AppImage $LOCAL_INSTALL_DIR; From 7bb78596265750a53c6baf387ad3ad354db12009 Mon Sep 17 00:00:00 2001 From: GermanBread <71450236+GermanBread@users.noreply.github.com> Date: Sat, 13 Feb 2021 16:26:51 +0100 Subject: [PATCH 20/20] It wouldn't be a good merge if I forgot some unnecessary stuff I also made wget and unzip quiet --- LULI.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/LULI.sh b/LULI.sh index 471f3f6..b440edc 100644 --- a/LULI.sh +++ b/LULI.sh @@ -166,7 +166,6 @@ case $method in rm -rf Lightcord.*; rm -rf Lightcord; rm -rf lightcord-linux-x64.*; - rm 0 ;; 2) # Uninstall LC @@ -203,7 +202,6 @@ case $method in rm -rf Lightcord.*; rm -rf Lightcord; rm -rf lightcord-linux-x64.*; - rm 0 ;; *) # Do nothing @@ -248,7 +246,7 @@ case $method in Info 'Installing Lightcord' SubInfo "Downloading Lightcord" wget -qO lightcord.AppImage $LC_APPIMAGE; - if [ $? > '0' ]; then + if [ ! $? ]; then SubInfo "Trying alternate URL" wget -qO lightcord.AppImage $ALT_LC_APPIMAGE; fi @@ -262,7 +260,6 @@ case $method in SubInfo "Creating local desktop entry" echo -e "[Desktop Entry]\nName=Lightcord\nComment[fr_FR]=Un client Discord simple et personalisable\nComment=A simple - customizable - Discord Client\nExec=$LOCAL_INSTALL_DIR/lightcord.AppImage\nIcon=lightcord\nTerminal=false\nType=Application\nCategories=Network;InstantMessaging;P2P;" >> ~/.local/share/applications/lightcord.desktop; SubInfo "Cleaning up" - rm 0 ;; 2) # Uninstall LC @@ -281,7 +278,7 @@ case $method in rm $LOCAL_INSTALL_DIR/lightcord.AppImage; SubInfo "Downloading Lightcord" wget -qO lightcord.AppImage $LC_APPIMAGE; - if [ $? > '0' ]; then + if [ ! $? ]; then SubInfo "Trying alternate URL" wget -qO lightcord.AppImage $ALT_LC_APPIMAGE; fi @@ -289,7 +286,6 @@ case $method in mv lightcord.AppImage $LOCAL_INSTALL_DIR; chmod +x $LOCAL_INSTALL_DIR/lightcord.AppImage; SubInfo "Cleaning up" - rm 0 ;; *)