Skip to content

Instantly share code, notes, and snippets.

@awsfanatic
Created December 12, 2010 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awsfanatic/737915 to your computer and use it in GitHub Desktop.
Save awsfanatic/737915 to your computer and use it in GitHub Desktop.
Скрипт установки Битрикса для ISPmanager
#!/bin/sh
COMMAND=$1
DESTFOLDER=$2/$3
DISTFILE=$4
DBHOST=$5
DBNAME=$6
DBUSER=$7
DBPASS=$8
if [ `uname` = 'FreeBSD' ]; then
SED="sed -E"
else
SED="sed -re"
fi
case $COMMAND in
install)
TMP=`mktemp -d /tmp/bx.XXXXXX`
cd $TMP;
trap "cd /; rm -rf $TMP" EXIT
tar --extract --gzip --file $DISTFILE || exit 1
find bitrix -maxdepth 1 -mindepth 1 -exec cp -Rf '{}' $DESTFOLDER ';'
$SED "s/DBName = '.*';/DBName = '$DBNAME';/;s/DBLogin = '.*';/DBLogin = '$DBUSER';/;s/DBPassword = '.*'/DBPassword = '$DBPASS'/;s/DBHost = '.*'/DBHost = '$DBHOST'/" $DESTFOLDER/bitrix/php_interface/dbconn.php.example > $DESTFOLDER/bitrix/php_interface/dbconn.php
;;
postinstall)
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment