-
Notifications
You must be signed in to change notification settings - Fork 18
/
INSTALL.sh
executable file
·74 lines (69 loc) · 2.57 KB
/
INSTALL.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
#
# Installation script for hcxdumptool and hcxtools, for the Pineapple NANO and TETRA.
# Written by: Andreas Nilsen - [email protected] - https://www.github.com/adde88
#
#
display_help() {
echo "Usage: `basename $0` [option...]" >&2
echo
echo " -c, --custom Install custom version "
echo
echo
echo "Install script made by Andreas Nilsen @adde88"
exit 1
}
original(){
echo -e "Installing: hcxdumptool and hcxtools, original version from official OpenWRT repositories."
opkg update
if [ -e /sd ]; then
# Nano install (Let's use the SD-card, if it exists)
opkg --dest sd install hcxdumptool hcxtools --force-overwrite
else
# Tetra install / general install.
opkg install hcxdumptool hcxtools --force-overwrite
fi
echo -e "Finished installing hcxdumptool and hcxtools (official versions from OpenWRT)."
echo -e "-@adde88"
exit 0
}
bleeding_edge() {
# Let's always get the latest versions
mkdir -p /tmp/HcxTools
wget https://github.com/adde88/hcxtools-hcxdumptool-openwrt/tree/openwrt-19.07-mk7/bin/packages/mipsel_24kc/custom -P /tmp/HcxTools 2&>1 >/dev/null
HCXDUMPTOOL=`grep -F "hcxdumptool-custom_" /tmp/HcxTools/custom | awk {'print $8'} | awk -F'"' {'print $2'} | grep "mipsel_24kc" `
HCXTOOLS=`grep -F "hcxtools-custom_" /tmp/HcxTools/custom | awk {'print $8'} | awk -F'"' {'print $2'} | grep "mipsel_24kc"`
#
# Tell the user what's going on...
echo -e "Installing: hcxdumptool and hcxtools (custom bleeding-edge v6.1.4, from @adde88)"
#
# Download latest IPK's to temp directory, and then update OPKG repositories.
cd /tmp
opkg update
wget "https://github.com/adde88/hcxtools-hcxdumptool-openwrt/raw/openwrt-19.07-mk7/bin/packages/mipsel_24kc/custom/"$HCXTOOLS"" 2&>1 >/dev/null
wget "https://github.com/adde88/hcxtools-hcxdumptool-openwrt/raw/openwrt-19.07-mk7/bin/packages/mipsel_24kc/custom/"$HCXDUMPTOOL"" 2&>1 >/dev/null
#
# Install procedure
if [ -e /sd ]; then
# Nano install (Let's use the SD-card, if it exists)
opkg --dest sd install "$HCXTOOLS" "$HCXDUMPTOOL" --force-overwrite
else
# Tetra install / general install.
opkg install "$HCXTOOLS" "$HCXDUMPTOOL" --force-overwrite
fi
#
# Cleanup
rm -rf "$HCXTOOLS" "$HCXDUMPTOOL" /tmp/HcxTools/
echo -e "Finished installing hcxdumptool and hcxtools (custom bleeding-edge v6.1.4)."
echo -e "-@adde88"
exit 0
}
for arg in "$@"
do
if [ "$arg" == "-h" ] || [ "$arg" == "--help" ]; then
display_help
elif [ "$arg" == "-c" ] || [ "$arg" == "--custom" ]; then
bleeding_edge
fi
done
original