-
Notifications
You must be signed in to change notification settings - Fork 34
/
install.sh
32 lines (30 loc) · 1.3 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
#!/bin/sh
# https://github.com/robzr/bearDropper
# bearDropper install script - @robzr
if [ -f /etc/init.d/bearDropper ] ; then
echo Detected previous version of bearDropper - stopping
/etc/init.d/bearDropper stop
fi
echo -e 'Retrieving and installing latest version'
wget -qO /etc/init.d/bearDropper http://rawgit.com/robzr/bearDropper/master/src/init.d/bearDropper
wget -qO /etc/config/bearDropper http://rawgit.com/robzr/bearDropper/master/src/config/bearDropper
wget -qO /usr/sbin/bearDropper http://rawgit.com/robzr/bearDropper/master/bearDropper
chmod 755 /usr/sbin/bearDropper /etc/init.d/bearDropper
echo -e 'Processing historical log data (this can take a while)'
/usr/sbin/bearDropper -m entire -f stdout
echo -e 'Starting background process'
/etc/init.d/bearDropper enable
/etc/init.d/bearDropper start
dropbear_count=$(uci show dropbear | grep -c =dropbear)
dropbear_count=$((dropbear_count - 1))
for instance in $(seq 0 $dropbear_count); do
dropbear_verbose=$(uci -q get dropbear.@dropbear[$instance].verbose || echo 0)
if [ $dropbear_verbose -eq 0 ]; then
uci set dropbear.@dropbear[$instance].verbose=1
dropbear_conf_updated=1
fi
done
if [ $dropbear_conf_updated ]; then
uci commit
echo "Verbose logging was configured for dropbear. Please restart the service to enable this change."
fi