initial commit of a *whole bunch* of old Egressive shell scripts, used to make many people redundant.
This commit is contained in:
commit
43e0f5b59e
329 changed files with 31937 additions and 0 deletions
46
egdrupalhelpers/egdrupalinit
Executable file
46
egdrupalhelpers/egdrupalinit
Executable file
|
@ -0,0 +1,46 @@
|
|||
#!/bin/bash
|
||||
|
||||
CORE=${CORE-6.x}
|
||||
DEVGROUP=${DEVGROUP-drupaladm}
|
||||
DIRMODE=${DIRMODE-2775}
|
||||
|
||||
base=${1-/home/drupal}
|
||||
|
||||
if [ $UID -ne 0 ] ; then
|
||||
echo "This script must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Exit on any error
|
||||
set -e
|
||||
|
||||
# Create directories
|
||||
mkdir --mode=$DIRMODE -v $base
|
||||
chgrp -v $DEVGROUP $base
|
||||
|
||||
for dir in core contrib libraries sites ; do
|
||||
if [ -d "$base/$dir" ] ; then
|
||||
echo "Directory $dir already exists ... skipping"
|
||||
continue
|
||||
fi
|
||||
mkdir --mode=$DIRMODE -v $base/$dir
|
||||
chgrp -v $DEVGROUP $base/$dir
|
||||
done
|
||||
|
||||
# Get drush
|
||||
egdrupalsymlinks -c $CORE -b $base -d drush
|
||||
# This is a bit of a hack way to get the drush path
|
||||
drush=`find $base/drush -type f -name 'drush' | sort | tail -n 1`
|
||||
|
||||
# Get core
|
||||
version=`xmlstarlet sel --net --text --template --match "/project/releases/release[position()=1]/version" --value-of . --nl http://updates.drupal.org/release-history/drupal/$CORE`
|
||||
echo "Downloading drupal-$version"
|
||||
pushd $base/core
|
||||
$drush dl drupal-$version
|
||||
|
||||
# Add core version to platform map
|
||||
echo "drupal-$version $base/core/drupal-$version" >> /etc/egscripts/drupal-platform.map
|
||||
|
||||
# Set permissions on sites directory
|
||||
chgrp -v $DEVGROUP $base/core/drupal-$version/sites
|
||||
chmod -v g+ws $base/core/drupal-$version/sites
|
Loading…
Add table
Add a link
Reference in a new issue