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