#!/bin/sh -e

##########################################################################
#   Script description:
#       Enable autologout on all nodes
#
#   Arguments:
#       Time in minutes
#       
#   History:
#   Date        Name        Modification
#   2018-12-07  J Bacon     Begin
##########################################################################

usage()
{
    printf "Usage: $0 minutes\n"
    exit 1
}


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

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

auto-root-check $0

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

# Add autologout and TMOUT to non-head nodes
minutes=$1
cluster-run "auto-enable-autologout $minutes" all
