Skip to content

Commit

Permalink
feat: initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyl02 committed Jan 17, 2023
1 parent a9f4208 commit adc3c12
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ jobs:
- uses: softprops/action-gh-release@v1
with:
files: |
build/package/rvpn_linux_*.tar.gz
rvpn_linux_*.tar.gz
build/rvpn-amd64-installer.exe
43 changes: 40 additions & 3 deletions support/install.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,45 @@
#!/bin/bash

# download tar
set -euo pipefail

version="v0.0.1"
arch="amd64" # FIXME

# extract tar
err() {
echo "$@" >&2
}

# install rvpn and rvpn service
main() {

# setup tempdir
tmpdir="$(mktemp -d)"
cd "$tmpdir"
cleanup() {
[ -z "$tmpdir" ] || rm -rf "$tmpdir"
}
trap cleanup EXIT

# detect sudo
if [ "$(id -u)" -eq 0 ]; then
sudo=''
elif command -v sudo >/dev/null; then
sudo=sudo
elif command -v doas >/dev/null; then
sudo=doas
else
err 'You must be root'
exit 1
fi

# download tar
curl -o rvpn.tar.gz "https://github.com/redpwn/rvpn/releases/download/$version/rvpn_linux_$arch.tar.gz"

# extract tar
tar -xzvf rvpn.tar.gz

# install rvpn and rvpn service
$sudo install rvpn_linux_$arch/systemd/rvpn.service /etc/systemd/system/
$sudo install rvpn_linux_$arch/bin/rvpn /usr/local/bin
}

main

0 comments on commit adc3c12

Please sign in to comment.