[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cpx] creation of a default home page



On Tue, 7 Dec 2004 11:10:13 -0500
"Stormer's Cgi-Archive" <stormer@xxxxxxxxxxx> wrote:

> I used to have a program that did that for me on vps1.   However, the 
> program cannot get past permissions/ownership on a vps2.

	This might be better posted to the VPS2 list, but here is part
of our "new account" script if it helps. 
~/skel/default_htdocs/www/htdocs/ is a folder created ahead of time
under /root.

=====
#!/bin/csh

set u=""
while ("$u" == "")
  echo -n "Enter the new account's username: "
  set u=$<
end
if ("$u" == "") exit

echo -n "Enter the new account's domain [$u.com]: "
set d=$<
if ("$d" == "") set d="$u.com"

echo "Creating folders..."
mkdir "/home/$u/www" || echo "Couldn't create /home/$u/www!" && exit
mkdir "/home/$u/www/htdocs" || echo "Couldn't create /home/$u/www/htdocs!" && exit

echo "Copying default site files..."
cp ~/skel/default_htdocs/www/htdocs/* "/home/$u/www/htdocs" || echo "Error copying files!" && exit

echo "Changing permissions..."
chown -h -R "$u" "/home/$u/www" || echo "Couldn't change ownership of contents of /home/$u/www!" && exit
chown -h -R :www "/home/$u/www" || echo "Couldn't change ownership of contents of /home/$u/www!" && exit
chmod o= "/home/$u/www" || echo "Couldn't change permissions of /home/$u/www!" && exit
=====

	One hangup for you might have been that I had to put the chown's
on two lines as I couldn't get the script to substitute correctly for
"$u:www" on one line.

Steve Yates
Integrated Technical Solutions, Inc.

www.teamITS.com
630.420.2550
630.420.2771 (fax)



======================================================================
This is <cpx@xxxxxxxxxxxxx>      <http://www.groupmail.org/lists/cpx/>
Before posting a question, please search the archives (see above URL).


Home | Main Index | Thread Index
Match: Format: Sort by:
Search: