Skip to content

Commit adc3c12

Browse files
committed
feat: initial release
1 parent a9f4208 commit adc3c12

File tree

2 files changed

+41
-4
lines changed

2 files changed

+41
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,5 @@ jobs:
7777
- uses: softprops/action-gh-release@v1
7878
with:
7979
files: |
80-
build/package/rvpn_linux_*.tar.gz
80+
rvpn_linux_*.tar.gz
8181
build/rvpn-amd64-installer.exe

support/install.sh

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,45 @@
11
#!/bin/bash
22

3-
# download tar
3+
set -euo pipefail
44

5+
version="v0.0.1"
6+
arch="amd64" # FIXME
57

6-
# extract tar
8+
err() {
9+
echo "$@" >&2
10+
}
711

8-
# install rvpn and rvpn service
12+
main() {
13+
14+
# setup tempdir
15+
tmpdir="$(mktemp -d)"
16+
cd "$tmpdir"
17+
cleanup() {
18+
[ -z "$tmpdir" ] || rm -rf "$tmpdir"
19+
}
20+
trap cleanup EXIT
21+
22+
# detect sudo
23+
if [ "$(id -u)" -eq 0 ]; then
24+
sudo=''
25+
elif command -v sudo >/dev/null; then
26+
sudo=sudo
27+
elif command -v doas >/dev/null; then
28+
sudo=doas
29+
else
30+
err 'You must be root'
31+
exit 1
32+
fi
33+
34+
# download tar
35+
curl -o rvpn.tar.gz "https://github.com/redpwn/rvpn/releases/download/$version/rvpn_linux_$arch.tar.gz"
36+
37+
# extract tar
38+
tar -xzvf rvpn.tar.gz
39+
40+
# install rvpn and rvpn service
41+
$sudo install rvpn_linux_$arch/systemd/rvpn.service /etc/systemd/system/
42+
$sudo install rvpn_linux_$arch/bin/rvpn /usr/local/bin
43+
}
44+
45+
main

0 commit comments

Comments
 (0)