wok diff asterisk/receipt @ rev 1806

Asterisk: update mysql config
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Dec 03 14:10:46 2008 +0000 (2008-12-03)
parents 03a799424aaa
children 45e6c1f3da4f
line diff
     1.1 --- a/asterisk/receipt	Fri Sep 26 09:21:16 2008 +0000
     1.2 +++ b/asterisk/receipt	Wed Dec 03 14:10:46 2008 +0000
     1.3 @@ -34,6 +34,37 @@
     1.4  	for i in $fs/etc/asterisk/*.sample; do
     1.5  		mv $i ${i%.sample}
     1.6  	done
     1.7 +	cp -a stuff/* $fs
     1.8 +}
     1.9 +
    1.10 +# Rules to configure package
    1.11 +setup_rules()
    1.12 +{
    1.13 +	case "$2" in
    1.14 +	mysql_host)
    1.15 +		sed -i "s|^hostname=.*|hostname=$3|" $1/etc/asterisk/cdr_mysql.conf
    1.16 +		sed -i "s|^dbhost=.*|dbhost=$3|" $1/etc/asterisk/res_mysqlconf
    1.17 +		;;
    1.18 +	mysql_user)
    1.19 +		sed -i "s|^user=.*|user=$3|" $1/etc/asterisk/cdr_mysql.conf
    1.20 +		sed -i "s|^dbuser=.*|dbuser=$3|" $1/etc/asterisk/res_mysqlconf
    1.21 +		;;
    1.22 +	mysql_password)
    1.23 +		sed -i "s|^password=.*|password=$3|" $1/etc/asterisk/cdr_mysql.conf
    1.24 +		sed -i "s|^dbpass=.*|dbpass=$3|" $1/etc/asterisk/res_mysqlconf
    1.25 +		;;
    1.26 +	mysql_database)
    1.27 +		sed -i "s|^dbname=.*|dbname=$3|" $1/etc/asterisk/res_mysqlconf \
    1.28 +						 $1/etc/asterisk/cdr_mysql.conf
    1.29 +		;;
    1.30 +	*)	cat <<EOT
    1.31 +mysql_host	hostname or ip of mysql server
    1.32 +mysql_user	username to connect to mysql server
    1.33 +mysql_password	password to connect to mysql server
    1.34 +mysql_database	database used by asterisk
    1.35 +EOT
    1.36 +		;;
    1.37 +	esac
    1.38  }
    1.39  
    1.40  # Pre and post install commands for Tazpkg.