6 export DEBIAN_FRONTEND
=noninteractive
10 if [ ${ID} = "debian" ]; then
11 if [ -f /etc
/apt
/sources.list.d
/debian.sources
]; then
12 sed "s/main/non-free contrib/g" /etc
/apt
/sources.list.d
/debian.sources
> /etc
/apt
/sources.list.d
/debian-nonfree.sources
15 apt-get
-y install software-properties-common
16 apt-add-repository non-free
20 apt-get
-y install perl \
32 snmp-mibs-downloader \
43 libhttp-daemon-ssl-perl \
54 libmonitoring-plugin-perl \
55 libcurl4-openssl-dev \
66 # remove ipv6 interface from hosts
67 sed '/^::1/d' /etc
/hosts
> /tmp
/hosts
68 cp -f /tmp
/hosts
/etc
/hosts
75 # replace snakeoil certs with openssl generated ones as the make-ssl-cert ones
76 # seems to cause problems with our plugins
77 rm /etc
/ssl
/certs
/ssl-cert-snakeoil.pem
78 rm /etc
/ssl
/private
/ssl-cert-snakeoil.key
79 openssl req
-nodes -newkey rsa
:2048 -x509 -sha256 -days 365 -nodes -keyout /etc
/ssl
/private
/ssl-cert-snakeoil.key
-out /etc
/ssl
/certs
/ssl-cert-snakeoil.pem
-subj "/C=GB/ST=London/L=London/O=Global Security/OU=IT Department/CN=$(hostname)"
80 service apache2 restart
83 cp tools
/squid.conf
/etc
/squid
/squid.conf
87 service mariadb start || service mysql start
88 mysql
-e "create database IF NOT EXISTS test;" -uroot
91 sed -e 's/cn=admin,dc=nodomain/'$
(/usr
/sbin
/slapcat|
grep ^dn
:|
awk '{print $2}')'/' -i .github
/NPTest.cache
95 ssh-keygen
-t rsa
-N "" -f ~
/.ssh
/id_rsa
96 cat ~
/.ssh
/id_rsa.pub
>> ~
/.ssh
/authorized_keys
99 ssh-keyscan localhost
>> ~
/.ssh
/known_hosts
102 # start one login session, required for check_users
103 ssh -tt localhost
</dev
/null
>/dev
/null
2>/dev
/null
&
108 mkdir
-p /var
/lib
/snmp
/mib_indexes
109 sed -e 's/^agentaddress.*/agentaddress 127.0.0.1/' -i /etc
/snmp
/snmpd.conf
112 # start cron, will be used by check_nagios
116 cat <<EOD >> /etc/postfix/master.cf
117 smtps inet n - n - - smtpd
118 -o smtpd_tls_wrappermode=yes
120 service postfix start
126 sed "/NP_HOST_TLS_CERT/s/.*/'NP_HOST_TLS_CERT' => '$(hostname)',/" -i /src
/.github
/NPTest.cache
128 # create some test files to lower inodes
129 for i
in $
(seq 10); do
130 touch /media
/ramdisk
2/test.
$i