File tree Expand file tree Collapse file tree 2 files changed +41
-4
lines changed Expand file tree Collapse file tree 2 files changed +41
-4
lines changed Original file line number Diff line number Diff line change 77
77
- uses : softprops/action-gh-release@v1
78
78
with :
79
79
files : |
80
- build/package/ rvpn_linux_*.tar.gz
80
+ rvpn_linux_*.tar.gz
81
81
build/rvpn-amd64-installer.exe
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- # download tar
3
+ set -euo pipefail
4
4
5
+ version=" v0.0.1"
6
+ arch=" amd64" # FIXME
5
7
6
- # extract tar
8
+ err () {
9
+ echo " $@ " >&2
10
+ }
7
11
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
You can’t perform that action at this time.
0 commit comments