File: apache.sh

package info (click to toggle)
gforge 4.5.14-22etch13
  • links: PTS
  • area: main
  • in suites: etch
  • size: 13,004 kB
  • ctags: 11,918
  • sloc: php: 36,047; sql: 29,050; sh: 10,538; perl: 6,496; xml: 3,810; makefile: 341; python: 263; ansic: 256
file content (33 lines) | stat: -rwxr-xr-x 914 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash

echo -n "Checking Project Web Directories: "

for i in `cd /home/groups ; ls | grep -v lost+found | grep -v quota.group | grep -v ^ftp` ; do
	if [ ! -d /home/groups/$i/log ] ; then
		mkdir /home/groups/$i/log
		chown dummy:$i /home/groups/$i/log
		chmod 0774 /home/groups/$i/log
	fi

	if [ ! -d /home/groups/$i/cgi-bin ] ; then
		mkdir /home/groups/$i/cgi-bin
		chown dummy:$i /home/groups/$i/cgi-bin
		chmod 0774 /home/groups/$i/cgi-bin
	fi

	if [ ! -d /home/groups/$i/htdocs ] ; then
		mkdir /home/groups/$i/htdocs
		chown dummy:$i /home/groups/$i/htdocs
		chmod 0774 /home/groups/$i/htdocs
	fi

	if [ "`ls /home/groups/$i/htdocs/`" = "" ] ; then
		cp /root/alexandria/utils/default_page.php /home/groups/$i/htdocs/index.php
		chown dummy:$i /home/groups/$i/htdocs/index.php
                chmod 0664 /home/groups/$i/htdocs/index.php
        fi
done

echo "Done."

/etc/rc.d/init.d/apache restart