diff options
Diffstat (limited to '.github/prepare_debian.sh')
-rwxr-xr-x | .github/prepare_debian.sh | 92 |
1 files changed, 63 insertions, 29 deletions
diff --git a/.github/prepare_debian.sh b/.github/prepare_debian.sh index 4021c104..dcf778bc 100755 --- a/.github/prepare_debian.sh +++ b/.github/prepare_debian.sh | |||
@@ -5,27 +5,63 @@ set -e | |||
5 | 5 | ||
6 | export DEBIAN_FRONTEND=noninteractive | 6 | export DEBIAN_FRONTEND=noninteractive |
7 | 7 | ||
8 | apt-get update | 8 | source /etc/os-release |
9 | apt-get -y install software-properties-common | 9 | |
10 | if [ $(lsb_release -is) = "Debian" ]; then | 10 | if [ ${ID} = "debian" ]; then |
11 | apt-add-repository non-free | 11 | if [ -f /etc/apt/sources.list.d/debian.sources ]; then |
12 | apt-get update | 12 | sed "s/main/non-free contrib/g" /etc/apt/sources.list.d/debian.sources > /etc/apt/sources.list.d/debian-nonfree.sources |
13 | else | ||
14 | apt-get update | ||
15 | apt-get -y install software-properties-common | ||
16 | apt-add-repository non-free | ||
17 | fi | ||
13 | fi | 18 | fi |
14 | apt-get -y install perl autotools-dev libdbi-dev libldap2-dev libpq-dev libradcli-dev libnet-snmp-perl procps | 19 | apt-get update |
15 | apt-get -y install libdbi0-dev libdbd-sqlite3 libssl-dev dnsutils snmp-mibs-downloader libsnmp-perl snmpd | 20 | apt-get -y install perl \ |
16 | apt-get -y install fping snmp netcat-openbsd smbclient vsftpd apache2 ssl-cert postfix libhttp-daemon-ssl-perl | 21 | autotools-dev \ |
17 | apt-get -y install libdbd-sybase-perl libnet-dns-perl | 22 | libdbi-dev \ |
18 | apt-get -y install slapd ldap-utils | 23 | libldap2-dev \ |
19 | apt-get -y install gcc make autoconf automake gettext | 24 | libpq-dev \ |
20 | apt-get -y install faketime | 25 | libradcli-dev \ |
21 | apt-get -y install libmonitoring-plugin-perl | 26 | libnet-snmp-perl \ |
22 | apt-get -y install libcurl4-openssl-dev | 27 | procps \ |
23 | apt-get -y install liburiparser-dev | 28 | libdbi0-dev \ |
24 | apt-get -y install squid | 29 | libdbd-sqlite3 \ |
25 | apt-get -y install openssh-server | 30 | libssl-dev \ |
26 | apt-get -y install mariadb-server mariadb-client libmariadb-dev | 31 | dnsutils \ |
27 | apt-get -y install cron iputils-ping | 32 | snmp-mibs-downloader \ |
28 | apt-get -y install iproute2 | 33 | libsnmp-perl \ |
34 | snmpd \ | ||
35 | fping \ | ||
36 | snmp \ | ||
37 | netcat-openbsd \ | ||
38 | smbclient \ | ||
39 | vsftpd \ | ||
40 | apache2 \ | ||
41 | ssl-cert \ | ||
42 | postfix \ | ||
43 | libhttp-daemon-ssl-perl \ | ||
44 | libdbd-sybase-perl \ | ||
45 | libnet-dns-perl \ | ||
46 | slapd \ | ||
47 | ldap-utils \ | ||
48 | gcc \ | ||
49 | make \ | ||
50 | autoconf \ | ||
51 | automake \ | ||
52 | gettext \ | ||
53 | faketime \ | ||
54 | libmonitoring-plugin-perl \ | ||
55 | libcurl4-openssl-dev \ | ||
56 | liburiparser-dev \ | ||
57 | squid \ | ||
58 | openssh-server \ | ||
59 | mariadb-server \ | ||
60 | mariadb-client \ | ||
61 | libmariadb-dev \ | ||
62 | cron \ | ||
63 | iputils-ping \ | ||
64 | iproute2 | ||
29 | 65 | ||
30 | # remove ipv6 interface from hosts | 66 | # remove ipv6 interface from hosts |
31 | if [ $(ip addr show | grep "inet6 ::1" | wc -l) -eq "0" ]; then | 67 | if [ $(ip addr show | grep "inet6 ::1" | wc -l) -eq "0" ]; then |
@@ -37,7 +73,6 @@ ip addr show | |||
37 | 73 | ||
38 | cat /etc/hosts | 74 | cat /etc/hosts |
39 | 75 | ||
40 | |||
41 | # apache | 76 | # apache |
42 | a2enmod ssl | 77 | a2enmod ssl |
43 | a2ensite default-ssl | 78 | a2ensite default-ssl |
@@ -53,7 +88,7 @@ cp tools/squid.conf /etc/squid/squid.conf | |||
53 | service squid start | 88 | service squid start |
54 | 89 | ||
55 | # mariadb | 90 | # mariadb |
56 | service mariadb start | 91 | service mariadb start || service mysql start |
57 | mysql -e "create database IF NOT EXISTS test;" -uroot | 92 | mysql -e "create database IF NOT EXISTS test;" -uroot |
58 | 93 | ||
59 | # ldap | 94 | # ldap |
@@ -73,12 +108,7 @@ ssh -tt localhost </dev/null >/dev/null 2>/dev/null & | |||
73 | disown %1 | 108 | disown %1 |
74 | 109 | ||
75 | # snmpd | 110 | # snmpd |
76 | for DIR in /usr/share/snmp/mibs /usr/share/mibs; do | 111 | service snmpd stop |
77 | rm -f $DIR/ietf/SNMPv2-PDU \ | ||
78 | $DIR/ietf/IPSEC-SPD-MIB \ | ||
79 | $DIR/ietf/IPATM-IPMC-MIB \ | ||
80 | $DIR/iana/IANA-IPPM-METRICS-REGISTRY-MIB | ||
81 | done | ||
82 | mkdir -p /var/lib/snmp/mib_indexes | 112 | mkdir -p /var/lib/snmp/mib_indexes |
83 | sed -e 's/^agentaddress.*/agentaddress 127.0.0.1/' -i /etc/snmp/snmpd.conf | 113 | sed -e 's/^agentaddress.*/agentaddress 127.0.0.1/' -i /etc/snmp/snmpd.conf |
84 | service snmpd start | 114 | service snmpd start |
@@ -86,7 +116,11 @@ service snmpd start | |||
86 | # start cron, will be used by check_nagios | 116 | # start cron, will be used by check_nagios |
87 | cron | 117 | cron |
88 | 118 | ||
89 | # start postfix | 119 | # postfix |
120 | cat <<EOD >> /etc/postfix/master.cf | ||
121 | smtps inet n - n - - smtpd | ||
122 | -o smtpd_tls_wrappermode=yes | ||
123 | EOD | ||
90 | service postfix start | 124 | service postfix start |
91 | 125 | ||
92 | # start ftpd | 126 | # start ftpd |