|
1 | | -#!/bin/sh -e |
| 1 | +#!/bin/sh -eu |
2 | 2 |
|
3 | 3 | ################################################################################ |
4 | 4 | # Description: install the latest version of pixel-backup to the local directory |
5 | 5 | # Author: Vivek Revankar <vivek@master-hax.com> |
6 | 6 | # Usage: sh -c "$(curl -fSs https://raw.githubusercontent.com/master-hax/pixel-backup-gang/master/install.sh)" |
7 | 7 | ################################################################################ |
8 | 8 |
|
9 | | -pbg_tarball_url="https://github.com/master-hax/pixel-backup-gang/releases/download/0.0.2/pixel-backup-gang-0.0.2.tar.gz" |
10 | | -pbg_tarball_filename="pixel-backup-gang-latest.tar.gz" |
11 | | -echo "install.sh: downloading the latest release" |
12 | | -curl -fL $pbg_tarball_url --output $pbg_tarball_filename |
13 | | -echo "install.sh: unpacking the release archive (requires root)" |
14 | | -/sbin/su --command "tar -xvf $pbg_tarball_filename" |
15 | | -echo "install.sh: make the release executable (requires root)" |
16 | | -/sbin/su --command "chmod +x ./pixel-backup-gang/*.sh" |
| 9 | +pbg_tarball_version="0.0.2" |
| 10 | +pbg_tarball_filename="pixel-backup-gang-$pbg_tarball_version.tar.gz" |
| 11 | +pbg_tarball_url="https://github.com/master-hax/pixel-backup-gang/releases/download/$pbg_tarball_version/$pbg_tarball_filename" |
| 12 | +echo "install.sh: downloading version $pbg_tarball_version from github" |
| 13 | +curl -fL $pbg_tarball_url --output $pbg_tarball_filename || { echo 'failed to download release archive' ; exit 1; } |
| 14 | +echo "install.sh: unpacking the release archive (requires root)" || { echo 'failed to unpack release archive' ; exit 1; } |
| 15 | +su --command "tar -xvf $pbg_tarball_filename" || { echo 'failed to inflate release archive' ; exit 1; } |
| 16 | +echo "install.sh: making the release executable (requires root)" |
| 17 | +su --command "chmod +x ./pixel-backup-gang/*.sh" || { echo 'failed to make scripts executable' ; exit 1; } |
17 | 18 | echo "install.sh: pixel backup gang successfully installed to $(realpath ./pixel-backup-gang)" |
0 commit comments