Server IP : 104.244.120.118  /  Your IP : 216.73.216.198
Web Server : Apache
System : Linux ded5817.inmotionhosting.com 5.14.0-741.22.1.el9_9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 12 14:34:46 UTC 2026 x86_64
User : persoanlinjuryla ( 1006)
PHP Version : 8.5.13
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0555) :  /../../opt/dedrads/python/../python/../mailparse/../python/../python/../python/../

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //../../opt/dedrads/python/../python/../mailparse/../python/../python/../python/../unsusprunner.sh
#!/usr/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 CURRENTUSER in $(/bin/ls -A /opt/dedrads/suspended); do
	if [ -z "$CURRENTUSER" ]; then
		echo
		echo "* ERROR: Could not find any accounts pending unsuspension, exiting."
		echo
		exit 1
	else

		UNSUSPTIME=$(cat "/opt/dedrads/suspended/$CURRENTUSER" |awk '{print $1}')
		SUSPDURATION=$(cat "/opt/dedrads/suspended/$CURRENTUSER" |awk '{print $2}')
		if [[ "$NOW" != "nontemp" ]] && [[ "$NOW" -ge "$UNSUSPTIME" ]];then
			TOUNSUSPEND="$TOUNSUSPEND $CURRENTUSER"
		fi
	fi
done
unset CURRENTUSER

if [ ! -z "$TOUNSUSPEND" ]; then

	for CURRENTUSER in $TOUNSUSPEND
	do
		if [ -z "$UNSUSPTIME" ]; then
			echo
			echo "* ERROR: Could not determine length of suspension, exiting."
			echo
			echo "[$(date)] ERROR: could not determine length of suspension for $CURRENTUSER" >> /var/log/suspension.log
			rm -f "/opt/dedrads/suspended/$CURRENTUSER"
			exit 0

		elif [ "$UNSUSPTIME" == "nontemp" ]; then
			echo
			echo "* This is not a temporary suspension, leaving suspended and exiting."
			echo
			rm -f "/opt/dedrads/suspended/$CURRENTUSER"

		# If suspension time is greater than now, go ahead and unsuspend
		elif [ "$NOW" -ge "$UNSUSPTIME" ];then
			rm -f "/opt/dedrads/suspended/$CURRENTUSER"
			/scripts/unsuspendacct "$CURRENTUSER"
			echo "[$(date)] $SUSPDURATION suspension for $CURRENTUSER elapsed, account has been [UNSUSPENDED]" >> /var/log/suspension.log
			echo "[$(date)] $SUSPDURATION suspension for $CURRENTUSER elapsed, account has been [UNSUSPENDED]"
			logger -t "SUSPEND" "$SUSPDURATION suspension for $CURRENTUSER elapsed, account has been [UNSUSPENDED]"
		fi

	done
fi
## EOF ##