aboutsummaryrefslogtreecommitdiffstats
path: root/testing/csync2/csync2.post-install
diff options
context:
space:
mode:
Diffstat (limited to 'testing/csync2/csync2.post-install')
-rw-r--r--testing/csync2/csync2.post-install24
1 files changed, 24 insertions, 0 deletions
diff --git a/testing/csync2/csync2.post-install b/testing/csync2/csync2.post-install
new file mode 100644
index 0000000000..3c2ecc1ecf
--- /dev/null
+++ b/testing/csync2/csync2.post-install
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+SSL="/etc/csync2/csync2_ssl_"
+SERV="/etc/services"
+INETD="/etc/inetd.conf"
+
+if [ ! -f ${SSL}key.pem -o ! -f ${SSL}cert.pem ]; then
+ openssl genrsa -out ${SSL}key.pem 1024 &> /dev/null
+ yes '' | openssl req -new -key ${SSL}key.pem -out ${SSL}cert.csr &> /dev/null
+ openssl x509 -req -days 3600 -in ${SSL}cert.csr -out ${SSL}cert.pem -signkey ${SSL}key.pem &> /dev/null
+ rm ${SSL}cert.csr
+fi
+
+if [ ! -f ${SERV} ]; then
+ touch ${SERV}
+fi
+grep -q csync2 ${SERV} || echo -e "csync2\t\t30865/tcp" >> ${SERV}
+
+if [ ! -f ${INETD} ]; then
+ touch ${INETD}
+fi
+grep -q csync2 ${INETD} || echo "csync2 stream tcp nowait root /usr/sbin/csync2 csync2 -i" >> ${INETD}
+
+exit 0