Shutdown NOT super-user?
You are running ssh command locally as root and the remote bash (hence the whole script) as the user ADMIN@macxxx (without switching to root on the remote server).

You must precede either bash or shutdown with sudo (provided ADMIN has passwordless sudo permissions for shutdown or all commands on macxxx machine).

So either:

ssh ADMIN@macxxx 'sudo bash -s' &lt; ./documents/ShutdownUPTIME.sh


Or:

...
if [ $DAYS_UP -ge ${MAX_UPDAYS} ];then
    echo Mac is going to shutdown 
    sudo shutdown -h now
else
...