-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·84 lines (70 loc) · 1.64 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
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
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
source 'lib/apt-lib.sh'
require_root
runAptGetUpdate
installAptPackages libtool libusb-1.0.0-dev librtlsdr-dev rtl-sdr build-essential autoconf cmake pkg-config mosquitto git ruby
function install_rtl_433() {
if [ ! -d rtl_433 ]; then
git clone https://github.com/merbanan/rtl_433.git
fi
cd rtl_433
if [ ! -d build ]; then
mkdir build
fi
pushd .
cd build
cmake ../
if [ $? -eq 1 ]; then
echo "cmake failed - debug that"
exit 1
fi
make
if [ $? -eq 1 ]; then
echo "make failed - debug that"
exit 1
fi
sudo make install
if [ $? -eq 1 ]; then
echo "make install failed - debug that"
exit 1
else
echo "rtl_433 tools installed into /usr/local/"
fi
popd
}
if [ ! -f /etc/modprobe.d/blacklist-rtl.conf ]; then
echo "blacklist dvb_usb_rtl28xxu" | sudo tee -a /etc/modprobe.d/blacklist-rtl.conf
echo "blacklist file added - you need to reboot later"
fi
if have_command rtl_433; then
echo "rtl_433 detected - skipping install"
else
install_rtl_433
fi
if [ ! -f Gemfile.lock ]; then
if have_command bundle; then
bundle
if [ $? -eq 0 ]; then
echo "bundle success"
else
echo "BUNDLE INSTALL FAILED"
fi
else
if have_command gem; then
sudo gem install bundler
bundle
else
echo "ERROR: missing gem command needed to install bundler"
exit 1
fi
fi
fi
echo "install completed"
crontab -l | grep tmux-launch > /dev/null 2>&1
if [ $? -eq 0 ]; then
info "tmux-launch.sh already setup in crontab"
else
info 'add the following line to crontab to enable system as a tmux service'
echo "@reboot ${PWD}/tmux-launch.sh"
fi
echo "#### NOTE: If this is the first time setup you will likely need to reboot your computer."