wok-next diff get-softmodem-driver/stuff/martian.receipt @ rev 5304

Up: All Xorg driver (7.5 and up)
author Christophe Lincoln <pankso@slitaz.org>
date Mon Apr 19 22:14:19 2010 +0200 (2010-04-19)
parents 8fc90d8b565b
children
line diff
     1.1 --- a/get-softmodem-driver/stuff/martian.receipt	Thu Jun 18 14:43:23 2009 +0200
     1.2 +++ b/get-softmodem-driver/stuff/martian.receipt	Mon Apr 19 22:14:19 2010 +0200
     1.3 @@ -17,21 +17,33 @@
     1.4  	# Country settings
     1.5  	if [ -e /etc/TZ ]; then
     1.6  		ZONE=`cat /etc/TZ`
     1.7 -		CODE=`grep $ZONE /usr/share/softmodem/marszone.tab | cut -f1'`
     1.8 +		CODE=`grep $ZONE /usr/share/martian/zone.tab | cut -f1'`
     1.9  		if [ -n $CODE ]; then
    1.10 -			COUNTRY=`grep ^$CODE /usr/share/softmodem/martian.country | cut -f2`
    1.11 +			COUNTRY=`grep ^$CODE /usr/share/martian/martian.country | cut -f2`
    1.12 +			COUNTRY_NAME=`grep ^$CODE /usr/share/martian/martian.country | cut -f3`
    1.13  		fi
    1.14  	fi
    1.15  	if [ -z $COUNTRY ]; then
    1.16 -		COUNTRY="USA"
    1.17 +		COUNTRY="us"
    1.18 +		COUNTRY_NAME="USA"
    1.19  	fi
    1.20 -	cat >> $root/etc/daemons.conf << "EOT"
    1.21 -# martian daemon options.
    1.22 -MARTIAN_OPTIONS="--country=$COUNTRY"
    1.23 -
    1.24 -EOT
    1.25 +	echo "Automatic country setting: $COUNTRY_NAME"
    1.26 +	# Save options
    1.27 +	if [ `grep -c MARTIAN_OPTIONS /etc/daemons.conf` -gt 0 ]; then
    1.28 +		sed -i 's/MARTIAN_OPTIONS=.*/MARTIAN_OPTIONS="--country='"$COUNTRY"' \/dev\/ttySM0"/' /etc/daemons.conf
    1.29 +	else
    1.30 +	echo "# slmodemd daemon options." >> $root/etc/daemons.conf
    1.31 +		echo "MARTIAN_OPTIONS=\"--country=$COUNTRY /dev/ttySM0\"" >> $root/etc/daemons.conf
    1.32 +		echo  >> $root/etc/daemons.conf
    1.33 +	fi
    1.34  	# Load module
    1.35  	/sbin/depmod -a
    1.36  	/sbin/modprobe martian_dev && \
    1.37  	/etc/init.d/martian start
    1.38  }
    1.39 +
    1.40 +post_remove()
    1.41 +{
    1.42 +	/etc/init.d/martian stop
    1.43 +	rm -rf /usr/share/martian
    1.44 +}