Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.1
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
sp_scripts /
Delete
Unzip
Name
Size
Permission
Date
Action
accounts_audit.sh
1.05
KB
-rwxr-xr-x
2026-02-24 11:05
fix_cagefs
474
B
-rwxr-xr-x
2026-02-24 11:05
jb5_to_cpanel_convertor.sh
13.78
KB
-rwxr-xr-x
2026-02-24 11:05
log_flood_block.sh
5.18
KB
-rwxr-xr-x
2026-02-24 11:05
lstop.py
1.19
KB
-rwxr-xr-x
2026-02-24 11:05
phpmoves.sh
1.59
KB
-rwxr-xr-x
2026-02-24 11:05
post_transfer_cleanup.sh
3.28
KB
-rwxr-xr-x
2026-02-24 11:05
reseller_csf_priv.php
282
B
-rwxr-xr-x
2026-02-24 11:05
sp_remote_sql.php
2.73
KB
-rwxr-xr-x
2026-02-24 11:05
uap.py
3.83
KB
-rwxr-xr-x
2026-02-24 11:05
wellknown.sh
2.48
KB
-rwxr-xr-x
2026-02-24 11:05
Save
Rename
#!/bin/bash # # Post-Transfer Cleanup Script for cPanel Live Migration # Clears mail contents and document root files while preserving account structure # # Usage: ./post_transfer_cleanup.sh <username> [--dry-run] # Nikolay Ilchev 09/01/2026 CPUSER="${1:-}" DRY_RUN=0 [[ "${2:-}" == "--dry-run" ]] && DRY_RUN=1 if [[ -z "$CPUSER" ]]; then echo "Usage: $0 <username> [--dry-run]" exit 1 fi if [[ ! -f "/var/cpanel/users/$CPUSER" ]]; then echo "Error: $CPUSER is not a valid cPanel account" exit 1 fi BACKUP_FOUND=0 if [[ -d "/var/backuply" ]]; then BACKUPLY=$(find /var/backuply/backups/$CPUSER -name "*_backup_*_[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]_*.json" -mtime -7 -type f 2>/dev/null | head -1) if [[ -n "$BACKUPLY" ]]; then BACKUP_FOUND=1 echo "Backuply: $(basename "$BACKUPLY")" else echo "Backuply: No backup found, checking JetBackup..." fi else echo "Backuply: Not installed, checking JetBackup..." fi if [[ $BACKUP_FOUND -eq 0 ]] && command -v jetbackup5api &>/dev/null; then JB_DATA=$(jetbackup5api -F listAccounts -D "limit=1000" -O json 2>/dev/null | jq -r ".data.accounts[] | select(.username==\"$CPUSER\")") if [[ -n "$JB_DATA" ]]; then JB_ID=$(echo "$JB_DATA" | jq -r '._id') JB_FULL=$(echo "$JB_DATA" | jq -r '.backup_stats["511"]') if [[ -n "$JB_FULL" && "$JB_FULL" -gt 0 ]]; then BACKUP_FOUND=1 JB_LATEST=$(jetbackup5api -F listBackups -D "account_id=$JB_ID&type=1&contains=511&limit=200" -O json 2>/dev/null | jq -r '.data.backups | last | .created') echo "JetBackup: $JB_FULL full backups, latest: $JB_LATEST" fi fi fi if [[ $BACKUP_FOUND -eq 0 ]]; then echo "Error: No backup found for $CPUSER" exit 1 fi if [[ ! -f "/var/cpanel/suspended/$CPUSER" ]]; then echo "Error: Account $CPUSER is not suspended" exit 1 fi SUSPEND_REASON=$(cat "/var/cpanel/suspended/$CPUSER" 2>/dev/null) if [[ "$SUSPEND_REASON" != "User transferred to another server" ]]; then echo "Error: Wrong suspension reason: $SUSPEND_REASON" exit 1 fi HOMEDIR=$(grep "^$CPUSER:" /etc/passwd | cut -d: -f6) if [[ -z "$HOMEDIR" || ! -d "$HOMEDIR" ]]; then echo "Error: Cannot find home directory" exit 1 fi du -sh "$HOMEDIR" 2>/dev/null | awk '{print "Current usage: "$1}' DOCROOTS=$(grep DocumentRoot /etc/apache2/conf/httpd.conf | grep "/home/$CPUSER" | awk '{print $2}' | tr -d '"' | sort -u) echo "Cleaning document roots..." for docroot in $DOCROOTS; do [[ -d "$docroot" ]] && echo " $docroot" done echo "Cleaning mail directory..." [[ -d "$HOMEDIR/mail" ]] && echo " $HOMEDIR/mail" if [[ $DRY_RUN -eq 1 ]]; then echo "[DRY RUN] No changes made" exit 0 fi read -p "Proceed with deletion? (y/n): " CONFIRM if [[ "$CONFIRM" != "y" ]]; then echo "Aborted." exit 1 fi echo "Deleting..." for docroot in $DOCROOTS; do if [[ -d "$docroot" ]]; then su - "$CPUSER" -s /bin/bash -c "find '$docroot' -type f ! -name '.htaccess' -delete 2>/dev/null" su - "$CPUSER" -s /bin/bash -c "find '$docroot' -mindepth 1 -type d -empty -delete 2>/dev/null" fi done if [[ -d "$HOMEDIR/mail" ]]; then su - "$CPUSER" -s /bin/bash -c "find '$HOMEDIR/mail' -type f -delete 2>/dev/null" fi du -sh "$HOMEDIR" 2>/dev/null | awk '{print "New usage: "$1}' echo "Done."