Skip to content

Commit 4ee0847

Browse files
committed
Add install script
1 parent 1c344fa commit 4ee0847

File tree

3 files changed

+80
-4
lines changed

3 files changed

+80
-4
lines changed

README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,26 @@ decrypted, intercepted and recorded.
1515
This is the development repository, check out the [https://hyperfox.org][1]
1616
site for usage information.
1717

18-
## Getting Hyperfox
18+
## Get `hyperfox`
1919

20-
See the [download](https://hyperfox.org/download) page for binary builds and
21-
compilation instructions.
20+
You can install arpfox to `/usr/local/bin` with the following command (requires
21+
admin privileges):
22+
23+
```
24+
curl -sL 'https://raw.githubusercontent.com/malfunkt/hyperfox/master/install.sh' | sh
25+
```
26+
27+
You can also grab the latest release from our [releases
28+
page](https://github.com/malfunkt/hyperfox/releases) and install it manually into
29+
another location.
30+
31+
## Build it yourself
32+
33+
In order to build `arpfox` you'll need Go and a C compiler:
34+
35+
```
36+
go install github.com/malfunkt/hyperfox
37+
```
2238

2339
## A common example: hyperfox with arpfox on Linux
2440

install.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/sh
2+
3+
WORK_DIR=/tmp
4+
BIN_DIR=/usr/local/bin
5+
6+
arch() {
7+
ARCH=$(uname -m)
8+
case $ARCH in
9+
x86_64) ARCH=amd64;;
10+
esac
11+
}
12+
13+
os() {
14+
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
15+
}
16+
17+
download() {
18+
LATEST_RELEASE_JSON="https://api.github.com/repos/malfunkt/hyperfox/releases/latest"
19+
DOWNLOAD_URL=$(curl --silent -L $LATEST_RELEASE_JSON | grep browser_download_url | sed s/'^.*: "'//g | sed s/'"$'//g | grep "$OS.*$ARCH")
20+
21+
if [ -z "$DOWNLOAD_URL" ]; then
22+
curl --silent -L $LATEST_RELEASE_JSON;
23+
echo "Github API is not working right now. Please try again later.";
24+
exit 1
25+
fi;
26+
27+
BASENAME=$(basename $DOWNLOAD_URL)
28+
29+
wget $DOWNLOAD_URL -O $WORK_DIR/$BASENAME
30+
31+
case $BASENAME in
32+
*.bz2)
33+
bzip2 -d $WORK_DIR/$BASENAME
34+
FILENAME=$WORK_DIR/hyperfox_${OS}_${ARCH}
35+
;;
36+
*.gz)
37+
gzip -dfv $WORK_DIR/$BASENAME
38+
FILENAME=$WORK_DIR/hyperfox_${OS}_${ARCH}
39+
;;
40+
*.zip)
41+
unzip -d $WORK_DIR -o $WORK_DIR/$BASENAME
42+
FILENAME=$WORK_DIR/hyperfox_${OS}_${ARCH}.exe
43+
;;
44+
*)
45+
echo "Don't know how to handle downloaded file $BASENAME" && exit 1
46+
;;
47+
esac
48+
49+
if [ -z "$FILENAME" ]; then
50+
echo "Could not install." && exit 1
51+
fi;
52+
53+
echo "This script needs root privileges in order to install into $BIN_DIR."
54+
sudo install -c -m 0755 $FILENAME $BIN_DIR/hyperfox
55+
rm $FILENAME
56+
}
57+
58+
arch
59+
os
60+
download

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
"upper.io/db.v2"
3535
)
3636

37-
const version = "1.0"
37+
const version = "1.9.7"
3838

3939
const (
4040
defaultAddress = `0.0.0.0`

0 commit comments

Comments
 (0)