Skip to content

Instantly share code, notes, and snippets.

@awsfanatic

awsfanatic/Bitrix.sh

Created Dec 12, 2010
Embed
What would you like to do?
Скрипт установки Битрикса для 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
You can’t perform that action at this time.