#!/bin/bash

_install() {
    \cp -f $BASEDIR/configs/ssh/sshd_config /etc/ssh/sshd_config
    if [[ $HOSTIP != '' ]];then
        sed -i "s/0.0.0.0/$HOSTIP/g" /etc/ssh/sshd_config
    fi

    service sshd restart > /dev/null 2>&1

}

_check() {
    _check="PASS"

    local listen=$(grep "ListenAddress" /etc/ssh/sshd_config |awk '{print $NF}')
    if [[ $listen == "0.0.0.0" ]];then
        _check="FAIL"
        PRINT_ERR "[ERROR] /etc/ssh/sshd_config ListenAddress=0.0.0.0 Not Allow."
    fi

}
