1e68c7e6231c9ebbc8069c855ee0779f01a662e7
[openssh-cn.git] / debian / postinst
1 #!/bin/sh
2
3 set -e
4 [ "$1" = "configure" ] || exit 0
5
6 . /usr/share/carnet-tools/functions.sh
7
8 if [ -f /etc/ssh/sshd_config ]; then
9   check_and_sed '^PermitRootLogin yes' \
10                 's/PermitRootLogin yes/PermitRootLogin no/g' \
11                 /etc/ssh/sshd_config || true
12
13   check_and_sed '^ReverseMappingCheck' \
14                 's/^ReverseMappingCheck/#ReverseMappingCheck/g' \
15                 /etc/ssh/sshd_config || true
16 fi
17
18 # restart
19 if [ -x /usr/sbin/invoke-rc.d ]; then
20   [ -x /etc/init.d/ssh ] && invoke-rc.d ssh restart
21 else
22   [ -x /etc/init.d/ssh ] && /etc/init.d/ssh restart
23 fi