#!/bin/sh -e

##########################################################################
#   Script description:
#       Lock a user's account on all nodes
#
#   Arguments:
#       Username
#       
#   History:
#   Date        Name        Modification
#   2018-11-06  J Bacon     Begin
##########################################################################

usage()
{
    printf "Usage: $0 user-name\n"
    exit 1
}


##########################################################################
#   Main
##########################################################################

if [ $# != 1 ]; then
    usage
fi

auto-root-check $0

if ! cluster-check-cron-updates; then
    exit 0
fi

user_name=$1

auto-lock-user $user_name
cluster-run "auto-lock-user $user_name" all
