Skip to content

Commit

Permalink
Add an install.sh again
Browse files Browse the repository at this point in the history
  • Loading branch information
arnested committed Jan 6, 2021
1 parent 60d4f93 commit 54f62b7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@ Download the `.deb` file and run:
```console
sudo dpkg -i ldddns_0.0.16_linux_amd64.deb
```

Or just run the following command which will download and install the
latest package for you:

```console
curl -fsSL https://raw.githubusercontent.com/arnested/ldddns/main/install.sh | bash
```
29 changes: 29 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

if [ -z "$BASH" ] ;then echo Please run this with bash; exit 1; fi

set -euo pipefail

ldddns_install() {
set -euo pipefail

tmpdir="$(mktemp -d)"

# Make a cleanup function
cleanup() {
rm --recursive --force -- "${tmpdir}"
}
trap cleanup EXIT

echo -n Finding latest package name...
package=$(curl --proto =https --fail -sSL "https://github.com/arnested/ldddns/releases/latest/download/checksums.txt" | grep -i $(uname -s) | grep $(dpkg --print-architecture) | grep \.deb | awk '{print $2}')
echo " $package"

echo Downloading $package...
curl --proto =https --fail --location --progress-bar --output "${tmpdir}/${package}" "https://github.com/arnested/ldddns/releases/latest/download/${package}"

echo Installing $package...
pkexec dpkg -i "${tmpdir}/${package}"
}

ldddns_install

0 comments on commit 54f62b7

Please sign in to comment.