HEX
Server: Apache
System: Linux host.fiblib.com 5.14.0-570.28.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 22 07:56:01 EDT 2025 x86_64
User: scientificreligi (1062)
PHP: 8.0.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //bin/backuply
#!/bin/bash

# Assume we run without the wrapper by default.
USE_CGROUP_WRAPPER=false

# Check if the --enduser_backup flag is passed.
for arg in "$@"; do
	
	# If it is, check if either cgroup v1 or v2 is available.
	if [[ "$arg" == "--enduser_backup" ]]; then
		if [[ (-f /sys/fs/cgroup/cgroup.controllers || ( -d /sys/fs/cgroup/cpu && -d /sys/fs/cgroup/memory && -d /sys/fs/cgroup/blkio )) && -f /var/backuply/conf/resource_limits_enabled ]]; then
			
			USE_CGROUP_WRAPPER=true
			
		fi
		
		# Since we found the flag, we can stop looping.
		break
	fi
done

# Use the cgroup wrapper. The wrapper itself will handle v1/v2 differences.
if [[ "$USE_CGROUP_WRAPPER" == true ]]; then
    
	/usr/local/backuply/bin/backuply-cgroup /usr/local/backuply/bin/php /usr/local/backuply/cli.php "$@"

# Run the command directly without the wrapper.
else
    /usr/local/backuply/bin/php /usr/local/backuply/cli.php "$@"
fi