#!/bin/bash
# First check that this is a valid username
grep "^${1}:" /etc/passwd > /dev/null 2>&1
if [ "$?" -ne "0" ]; then
echo "Sorry, cannot find user ${1} in /etc/passwd or you didn't supply a username"
echo "Usage: ${0} "
exit 1
fi
userdir=`grep "^${1}:" /etc/passwd | cut -d: -f6`
if [ -d ${userdir} ] ; then
echo "Changing to directory ${userdir}"
cd ${userdir} && chown -R ${1}:psacln httpdocs && chmod -R g+w httpdocs && find httpdocs -type d -exec chmod g+s {} \; && /etc/init.d/httpd reload
fi
Surgeons Net is an educational resource for surgeons. It's here that I'll make announcements about that website, but also write about any interesting developments in Surgery or useful snippets of information about IT. May also use it for a general rant about the NHS!
Sunday 17 February 2008
A Script to do the plesk directory permisson setup
I have previously posted about changes to the plesk httpdocs directory to get it to work well with Joomla. This is a little bash script I knocked up to do the job. Just pass the username as param 1
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment