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