#!/bin/sh dirroot=$1 if [ -f "$dirroot/_config.inc.php" ] then cd $dirroot find . -type d | xargs chmod 777 find . -type f | xargs chmod 666 chmod 644 login.php chmod 644 _config.inc.php echo "Permissions fixed!" else echo "$0: This script must be called with the web directory root as an argument. (eg. '$0 /home/user/www'). And the web directory root must contain a _config.inc.php file (just a simple test to make sure we run this script in the correct place)." exit; fi