-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change appearance of install script and add update section to Readme
- Loading branch information
1 parent
a4fdcfd
commit f8a2905
Showing
3 changed files
with
41 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,43 @@ | ||
#!/bin/bash | ||
echo "Check for updates..." | ||
LocalVersion=$(sed -n 1p version) | ||
LatestVersion=$(curl -Lsk 'https://github.com/Staubgeborener/klipper-backup/raw/main/version') | ||
|
||
if [[ $LatestVersion > $LocalVersion ]] ; then | ||
echo "New version $LatestVersion released! Start update" | ||
wget https://github.com/Staubgeborener/klipper-backup/releases/download/$LatestVersion/klipper-backup-main.zip | ||
LatestVersion=$(curl -Lsk 'https://github.com/Staubgeborener/klipper-backup-staging/raw/main/version') | ||
color=$'\e[1;36m' | ||
end=$'\e[0m' | ||
|
||
Klipper-Backup-Logo() { | ||
echo -e "${color} | ||
_ _ _ _ _ ________ | ||
| |_ | ||_| ___ ___ ___ ___ ___ | |_ ___ ___ | |_ _ _ ___ | |____| | | ||
| '_|| || || . || . || -_|| _||___|| . || .'|| _|| '_|| | || . | | (__) | | ||
|_,_||_||_|| _|| _||___||_| |___||__,||___||_,_||___|| _| | | | ||
|_| |_| |_| |________| | ||
${end}" | ||
} | ||
|
||
installation() { | ||
wget https://github.com/Staubgeborener/klipper-backup-staging/releases/download/$LatestVersion/klipper-backup-main.zip | ||
unzip -o klipper-backup-main.zip | ||
cp -R ./klipper-backup-main/* $(pwd) | ||
rm -rf klipper-backup-main klipper-backup-main.zip README.md | ||
chmod +x *.sh | ||
echo -e "\n${color}Finished! Now edit the .env file. You can find more details in the README.md file on Github: https://github.com/Staubgeborener/klipper-backup#configuration${end}" | ||
} | ||
|
||
updates() { | ||
LocalVersion=$(sed -n 1p version) | ||
if [[ $LatestVersion > $LocalVersion ]] ; then | ||
echo -e "${color}New version $LatestVersion released! Start update${end}\n" | ||
installation | ||
else | ||
echo "You are up-to-date" | ||
fi | ||
} | ||
|
||
Klipper-Backup-Logo | ||
if [[ ! -e "version" ]]; then | ||
echo -e "${color}Start installation...${end}\n" | ||
installation | ||
else | ||
echo "You are up-to-date" | ||
echo "Check for updates..." | ||
updates | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.2 | ||
0.3 |