Skip to content

Commit

Permalink
Release version 0.3
Browse files Browse the repository at this point in the history
Change appearance of install script and add update section to Readme
  • Loading branch information
Staubgeborener committed Apr 1, 2023
1 parent a4fdcfd commit f8a2905
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# klipper-backup
# klipper-backup 💾
Klipper backup script for manual or automated backups

This is a backup script to create manual or automated klipper backups in a github repository. You can [see an example](https://github.com/Staubgeborener/3dprint) of what it looks like in the end.
Expand Down Expand Up @@ -42,4 +42,7 @@ gcode:
command: bash /home/pi/klipper-backup/script.sh
timeout: 90.0
verbose: True
```
```

## Updates
You can run `./install.sh` now and then. The script is not only used for installation, but also checks whether there are current updates.
42 changes: 35 additions & 7 deletions install.sh
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
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2
0.3

0 comments on commit f8a2905

Please sign in to comment.