Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/smanonr..../opt/sharedra...
File: unsusprunner.sh
#!/bin/bash
[0] Fix | Delete
# Shared RADS Tools, written by Erik Soroka (eriks@imhadmin.net, ext 834)
[1] Fix | Delete
# this script gets executed by crontab to unsuspend temporary suspended accounts from RADS tool
[2] Fix | Delete
[3] Fix | Delete
NOW=$(date +%s)
[4] Fix | Delete
[5] Fix | Delete
# Pull a list of users to unsuspend
[6] Fix | Delete
for current_user in $(/bin/ls -A /opt/sharedrads/suspended)
[7] Fix | Delete
do
[8] Fix | Delete
if [ -z "$current_user" ]; then
[9] Fix | Delete
echo
[10] Fix | Delete
echo "* ERROR: Could not find any accounts pending unsuspension, exiting."
[11] Fix | Delete
echo
[12] Fix | Delete
exit 1
[13] Fix | Delete
else
[14] Fix | Delete
unsuspend_time=$(cat /opt/sharedrads/suspended/$current_user |awk '{print $1}')
[15] Fix | Delete
suspend_duration=$(cat /opt/sharedrads/suspended/$current_user |awk '{print $2}')
[16] Fix | Delete
[17] Fix | Delete
if [ "$unsuspend_time" == "nontemp" ]; then
[18] Fix | Delete
#this is not a temporary suspension, remove from queue and continue
[19] Fix | Delete
rm -f /opt/sharedrads/suspended/$current_user
[20] Fix | Delete
continue
[21] Fix | Delete
elif [ "$NOW" -ge "$unsuspend_time" ]; then
[22] Fix | Delete
suspend_reason=$(cat /opt/sharedrads/suspended/$current_user |awk '{print $2}')
[23] Fix | Delete
MSG="$suspend_duration suspension for $current_user elapsed"
[24] Fix | Delete
/opt/sharedrads/unsuspend_user $current_user --invoked-by "$0" -c "$MSG"
[25] Fix | Delete
echo "[`date`] $MSG, account has been [UNSUSPENDED]"
[26] Fix | Delete
rm -f /opt/sharedrads/suspended/$current_user
[27] Fix | Delete
fi
[28] Fix | Delete
fi
[29] Fix | Delete
done
[30] Fix | Delete
[31] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function