PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /opt/sharedrads/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : //opt/sharedrads/unsusprunner.sh

#!/bin/bash
# Shared RADS Tools, written by Erik Soroka (eriks@imhadmin.net, ext 834)
# this script gets executed by crontab to unsuspend temporary suspended accounts from RADS tool

NOW=$(date +%s)

# Pull a list of users to unsuspend
for current_user in $(/bin/ls -A /opt/sharedrads/suspended)
do
    if [ -z "$current_user" ]; then
        echo
        echo "* ERROR: Could not find any accounts pending unsuspension, exiting."
        echo
        exit 1
    else
        unsuspend_time=$(cat /opt/sharedrads/suspended/$current_user |awk '{print $1}')
        suspend_duration=$(cat /opt/sharedrads/suspended/$current_user |awk '{print $2}')

        if [ "$unsuspend_time" == "nontemp" ]; then
            #this is not a temporary suspension, remove from queue and continue
            rm -f /opt/sharedrads/suspended/$current_user
            continue
        elif [ "$NOW" -ge "$unsuspend_time" ]; then
            suspend_reason=$(cat /opt/sharedrads/suspended/$current_user |awk '{print $2}')
            MSG="$suspend_duration suspension for $current_user elapsed"
            /opt/sharedrads/unsuspend_user $current_user --invoked-by "$0" -c "$MSG"
            echo "[`date`] $MSG, account has been [UNSUSPENDED]"
            rm -f /opt/sharedrads/suspended/$current_user
        fi
    fi
done