# check if a new user whose uid and passwd were specified in /share/apps/configrepo/users_data/newuser.dat should be added to all the nodes in the coc cluster #/bin/bash username=$(cat /share/apps/configrepo/users_data/newuser.dat | awk '{print $2}') uid=$(cat /share/apps/configrepo/users_data/newuser.dat | awk '{print $3}') passwd=$(cat /share/apps/configrepo/users_data/newuser.dat | awk '{print $4}') rm -rf /share/apps/configrepo/users_data/addstatus_global.dat coc-sshreachable hosts=$(cat /share/tmp/ssh-reachable.dat) for rn in $hosts do ssh $rn "hostname ; sh /share/apps/local/bin/coc-check_user_local" echo ' ' done if [ ! -f /share/apps/configrepo/users_data/addstatus_global.dat ] && [ -f /share/apps/configrepo/users_data/newuser.dat ]; then echo '/share/apps/configrepo/users_data/addstatus_global.dat does not exist. New user can be added to the cluster' elif [ -f /share/apps/configrepo/users_data/addstatus_global.dat ] && [ -f /share/apps/configrepo/users_data/newuser.dat ]; then echo '/share/apps/configrepo/users_data/addstatus_global.dat exists. New user can not be added to the cluster' cat /share/apps/configrepo/users_data/addstatus_global.dat elif [ ! -f /share/apps/configrepo/users_data/newuser.dat ]; then echo '/share/apps/configrepo/users_data/newuser.dat does not exist. New user can not be added to the cluster' fi #rm -rf tem.dat