File: updateChroot.sh

package info (click to toggle)
dtc 0.35.5-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 18,824 kB
  • sloc: php: 50,739; sh: 8,596; makefile: 572; perl: 148; xml: 25
file content (24 lines) | stat: -rwxr-xr-x 534 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
MAIN_DIR=$1
CHROOT_PATH=$2
if [ -z ""$MAIN_DIR ]; then
	MAIN_DIR=/var/www/sites
fi
if [ -z ""$CHROOT_PATH ]; then
	CHROOT_PATH=/var/lib/dtc/chroot_template
fi
pushd $MAIN_DIR
for i in */*/subdomains/*/
do 
	echo "=> Updating chroot in $i..."
	if [ "`uname -s`" == "FreeBSD" ] ; then		# same for OSX?
		cp -fpRv $CHROOT_PATH/* $i
	else
		cp -fupRv $CHROOT_PATH/* $i
	fi
	# remove un-needed directories
	rm -rf $i/etc/pam.d
	rm -rf $i/etc/security
	# if we can't find nogroup, then set to 65534
	chown -R dtc:dtcgrp $i
done