#! /bin/bash

source /etc/profile

step=1
for (( i = 0; i < 60; i = (i+step) )); do
    allow_ossadm=`cat /etc/ssh/sshd_config | grep "AllowUsers ossadm\$"`
    allow_sopuser=`cat /etc/ssh/sshd_config | grep "AllowUsers sopuser"`
    if [ "x${allow_sopuser}" != "x" -a "x${allow_ossadm}" == "x" ]
    then
        echo "AllowUsers ossadm" >> /etc/ssh/sshd_config
        /usr/sbin/service sshd restart
    fi
    sleep $step
done
