forked from cureHsu/EZ-Wave
-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.sh
executable file
·49 lines (45 loc) · 1.73 KB
/
setup.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
#!/bin/bash
scapy_radio_clone(){
#sudo apt-get install mercurial -y
hg clone https://bitbucket.org/cybertools/scapy-radio
mv scapy-radio/ ${HOME}/
cp setup/gr-Zwave/preamble_impl* ${HOME}/scapy-radio/gnuradio/gr-Zwave/lib/
cp setup/gr-Zwave/packet_sink_impl* ${HOME}/scapy-radio/gnuradio/gr-Zwave/lib/
cp setup/gr-Zwave/preamble.h ${HOME}/scapy-radio/gnuradio/gr-Zwave/include/Zwave/
cp setup/gr-Zwave/Zwave_preamble.xml ${HOME}/scapy-radio/gnuradio/gr-Zwave/grc/
cp setup/install.sh ${HOME}/scapy-radio/
chmod 755 ${HOME}/scapy-radio/install.sh
cp setup/Zwave.grc ${HOME}/scapy-radio/gnuradio/grc
cp setup/scapy/layers/* ${HOME}/scapy-radio/scapy/scapy/layers
cp setup/scapy/modules/* ${HOME}/scapy-radio/scapy/scapy/modules
rm -rf ${HOME}/scapy-radio/utils
export PATH=$PATH:$HOME/EZ-Wave/tools
}
scapy_update() {
rm /usr/local/lib/python2.7/dist-packages/scapy/layers/ZWave*
rm /usr/local/lib/python2.7/dist-packages/scapy/layers/gnuradio*
rm /usr/local/lib/python2.7/dist-packages/scapy/modules/gnuradio*
cp setup/scapy/layers/ZWave.py /usr/local/lib/python2.7/dist-packages/scapy/layers/
cp setup/scapy/layers/gnuradio.py /usr/local/lib/python2.7/dist-packages/scapy/layers/
cp setup/scapy/modules/gnuradio.py /usr/local/lib/python2.7/dist-packages/scapy/modules/
python -m py_compile /usr/local/lib/python2.7/dist-packages/scapy/layers/ZWave.py
python -m py_compile /usr/local/lib/python2.7/dist-packages/scapy/layers/gnuradio.py
python -m py_compile /usr/local/lib/python2.7/dist-packages/scapy/modules/gnuradio.py
}
if [ $# -eq 0 ]; then
scapy_radio_clone
else
while [ $# -ne 0 ]; do
case $1 in
clone)
scapy_radio_clone
;;
update)
scapy_update
;;
*)
echo "Invalid option: $1"
esac
shift
done
fi