-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall.sh
68 lines (48 loc) · 1.82 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
#!/bin/bash
#########################################
## ENVIRONMENTAL CONFIG ##
#########################################
# Configure user nobody to match unRAID's settings
usermod -u 99 nobody
usermod -g 100 nobody
usermod -d /home nobody
chown -R nobody:users /home
# Disable SSH
rm -rf /etc/service/sshd /etc/my_init.d/00_regen_ssh_host_keys.sh
#########################################
## REPOSITORIES AND DEPENDENCIES ##
#########################################
# Repositories
echo 'deb http://archive.ubuntu.com/ubuntu trusty main universe restricted' > /etc/apt/sources.list
echo 'deb http://archive.ubuntu.com/ubuntu trusty-updates main universe restricted' >> /etc/apt/sources.list
# Update and dependencies
apt-get update -qq
apt-get install libpcap0.8
#########################################
## FILES, SERVICES AND CONFIGURATION ##
#########################################
# Set premissions on database and log directory
mkdir -p /config
chown -R nobody:users /config
chmod 755 -R /config
# Darkstat Service
mkdir -p /etc/service/darkstat
cat <<'EOT' > /etc/service/darkstat/run
#!/bin/bash
# darkstat startup service
chown -R nobody:users /config
/usr/local/sbin/darkstat -i $ETH -p $PORT -b $IP_HOST -l $IP_RANGE --no-daemon --chroot /config/ --daylog darkstat.log --import darkstat.db --export darkstat.db --user nobody
EOT
#########################################
## INTALLATION ##
#########################################
#Install darkstat
dpkg -i /files/dark*
# Make start scripts executable
chmod -R +x /etc/my_init.d/ /etc/service/
#########################################
## CLEANUP ##
#########################################
# Clean APT install files
apt-get clean -y
rm -rf /var/lib/apt/lists/* /var/cache/* /var/tmp/* rm -rf /files