summaryrefslogtreecommitdiffstats
path: root/debian/netdata.postinst.in
diff options
context:
space:
mode:
Diffstat (limited to 'debian/netdata.postinst.in')
-rw-r--r--debian/netdata.postinst.in30
1 files changed, 30 insertions, 0 deletions
diff --git a/debian/netdata.postinst.in b/debian/netdata.postinst.in
index 49ed64955..9a86f70bd 100644
--- a/debian/netdata.postinst.in
+++ b/debian/netdata.postinst.in
@@ -6,6 +6,14 @@ CONFFILE="/etc/netdata/health_alarm_notify.conf"
. /usr/share/debconf/confmodule
+new_config=
+
+cleanup() {
+ if [ "$new_config" ]; then
+ rm -f "$new_config"
+ fi
+}
+
case "$1" in
configure)
db_get netdata/send_email
@@ -13,6 +21,28 @@ case "$1" in
db_stop
+ trap cleanup EXIT
+ new_config="$(tempfile)"
+
+ cp -a /usr/share/netdata/netdata.conf "$new_config"
+ if [ "$permit_root_login" != true ]; then
+»·······»·······sed -i 's/^#*PermitRootLogin .*/PermitRootLogin yes/' \
+»·······»·······»·······"$new_config"
+»·······fi
+»·······if [ "$password_authentication" != true ]; then
+»·······»·······sed -i 's/^#PasswordAuthentication .*/PasswordAuthentication no/' \
+»·······»·······»·······"$new_config"
+»·······fi
+»·······mkdir -p /etc/ssh
+»·······ucf --three-way --debconf-ok \
+»·······»·······--sum-file /usr/share/openssh/sshd_config.md5sum \
+»·······»·······"$new_config" /etc/ssh/sshd_config
+»·······ucfr openssh-server /etc/ssh/sshd_config
+
+
+
+
+
case "${SEND_EMAIL}" in
true)
SEND_EMAIL="YES"