wok diff bash/receipt @ rev 17613

Up: expat 2.1.0
author Alexander Medvedev <devl547@gmail.com>
date Thu Feb 12 19:30:27 2015 +0000 (2015-02-12)
parents 142a4a0548c5
children d8a92df08ef7
line diff
     1.1 --- a/bash/receipt	Wed Oct 08 15:12:04 2014 +0200
     1.2 +++ b/bash/receipt	Thu Feb 12 19:30:27 2015 +0000
     1.3 @@ -89,36 +89,32 @@
     1.4  
     1.5  post_install()
     1.6  {
     1.7 -	local root
     1.8 -	root=$1
     1.9  	echo "Processing post-install commands..."
    1.10 -		echo -n "Do you want to set Bash to default (y/N) ? : "
    1.11 -		read -t 30 anser
    1.12 -		if [ "$anser" == "y" ]; then
    1.13 -			echo ""
    1.14 -			echo "Setting bash as default for all users"
    1.15 -			sed -i "s/:\/bin\/sh$/:\/bin\/bash/g"  /etc/passwd
    1.16 -			sed -i "s/:\/bin\/ksh$/:\/bin\/bash/g" /etc/passwd
    1.17 -			sed -i "s/:\/bin\/zsh$/:\/bin\/bash/g" /etc/passwd
    1.18 -			sed -i "s/:\/bin\/csh$/:\/bin\/bash/g" /etc/passwd	
    1.19 -			echo "Creating .bashrc file for all users"
    1.20 -			for i in `ls -d /home/*`
    1.21 -			    do
    1.22 -			    cp /etc/bashrc $i/.bashrc
    1.23 -			    done
    1.24 -			cp /etc/bashrc /root/.bashrc
    1.25 -			cp /etc/bashrc /etc/skel/.bashrc
    1.26 -		fi
    1.27 +	echo -n "Do you want to set Bash to default (y/N) ? : "
    1.28 +	read -t 30 anser
    1.29 +	if [ "$anser" == "y" ]; then
    1.30 +		echo ""
    1.31 +		echo "Setting bash as default for all users"
    1.32 +		sed -i "s/:\/bin\/sh$/:\/bin\/bash/g"  $1/etc/passwd
    1.33 +		sed -i "s/:\/bin\/ksh$/:\/bin\/bash/g" $1/etc/passwd
    1.34 +		sed -i "s/:\/bin\/zsh$/:\/bin\/bash/g" $1/etc/passwd
    1.35 +		sed -i "s/:\/bin\/csh$/:\/bin\/bash/g" $1/etc/passwd	
    1.36 +		echo "Creating .bashrc file for all users"
    1.37 +		for i in `ls -d $1/home/*`
    1.38 +		    do
    1.39 +		    cp $1/etc/bashrc $1$i/.bashrc
    1.40 +		    done
    1.41 +		cp $1/etc/bashrc $1/root/.bashrc
    1.42 +		cp $1/etc/bashrc $1/etc/skel/.bashrc
    1.43 +	fi
    1.44  }
    1.45  
    1.46  
    1.47  pre_remove()
    1.48  {
    1.49 -	local root
    1.50 -	root=$1
    1.51  	echo "Setting back sh as default for all users"
    1.52 -	sed -i "s/:\/bin\/bash$/:\/bin\/sh/g"  /etc/passwd
    1.53 -	if [ -f /etc/skel/.bashrc ]; then
    1.54 -	rm /etc/skel/.bashrc
    1.55 +	sed -i "s/:\/bin\/bash$/:\/bin\/sh/g"  $1/etc/passwd
    1.56 +	if [ -f $1/etc/skel/.bashrc ]; then
    1.57 +		rm $1/etc/skel/.bashrc
    1.58  	fi
    1.59  }