#!/usr/bin/perl # ----------------------------------------------------------------------------------------- # This script is meant to be run from the /home directory as root. It fixes the ownership # of the home directories so that it matches the name of the directory. This script comes # in handy when restoring backups on CPanel servers. # # ----------------------------------------------------------------------------------------- # To download other useful scripts, or to find web hosting for your web site visit: # # http://www.assortedinternet.com/ # ----------------------------------------------------------------------------------------- # # ----------------------------------------------------------------------------------------- # Author: Brian Teeter # Date: $Date: 2004/05/11 02:34:43 $ # Version: $Revision: 1.1 $ # ----------------------------------------------------------------------------------------- # ---------------------------------------------------------------- # Get all of the usernames assuming the directory names are the # same as the usernames: # ---------------------------------------------------------------- my @ls = `ls -1`; chop @ls; for ($i = 0; $i < $#ls; $i++) { $exec = "chown -R $ls[$i]:$ls[$i] $ls[$i]"; print("Executing: $exec \n"); system("$exec"); } exit;