Subversion Repositories ALCASAR

Rev

Rev 1157 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1157 Rev 1419
Line 1... Line 1...
1
#/bin/bash
1
#/bin/bash
2
# $Id: alcasar-dhcp.sh 1157 2013-07-16 10:48:11Z stephane $
2
# $Id: alcasar-dhcp.sh 1419 2014-07-24 15:40:16Z richard $
3
 
3
 
4
# alcasar-dhcp.sh
4
# alcasar-dhcp.sh
5
# by Rexy
5
# by Rexy
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
 
7
 
Line 73... Line 73...
73
		else
73
		else
74
		      $SED "s?.*dhcpgateway.*?#dhcpgateway\t\t$EXT_DHCP_IP?g" $CHILLI_CONF_FILE
74
		      $SED "s?.*dhcpgateway.*?#dhcpgateway\t\t$EXT_DHCP_IP?g" $CHILLI_CONF_FILE
75
		      $SED "s?.*dhcprelayagent.*?#dhcprelayagent\t\t$RELAY_DHCP_IP?g" $CHILLI_CONF_FILE
75
		      $SED "s?.*dhcprelayagent.*?#dhcprelayagent\t\t$RELAY_DHCP_IP?g" $CHILLI_CONF_FILE
76
		      $SED "s?.*dhcpgatewayport.*?#dhcpgatewayport\t\t$RELAY_DHCP_PORT?g" $CHILLI_CONF_FILE
76
		      $SED "s?.*dhcpgatewayport.*?#dhcpgatewayport\t\t$RELAY_DHCP_PORT?g" $CHILLI_CONF_FILE
77
		fi
77
		fi
78
		/etc/init.d/chilli restart
78
		/usr/bin/systemctl restart chilli
79
		;;
79
		;;
80
	--full|-full) # enable DHCP service on all range of IP addresses
80
	--full|-full) # enable DHCP service on all range of IP addresses
81
		$SED "s?^.*statip.*?#statip?g" $CHILLI_CONF_FILE
81
		$SED "s?^.*statip.*?#statip?g" $CHILLI_CONF_FILE
82
		$SED "s?^nodynip.*?#nodynip?g" $CHILLI_CONF_FILE
82
		$SED "s?^nodynip.*?#nodynip?g" $CHILLI_CONF_FILE
83
		$SED "s?^DHCP.*?DHCP=full?g" $ALCASAR_CONF_FILE
83
		$SED "s?^DHCP.*?DHCP=full?g" $ALCASAR_CONF_FILE
Line 88... Line 88...
88
		$SED "s?^dhcprelayagent.*?#dhcprelayagent\t\t$RELAY_DHCP_IP?g" $CHILLI_CONF_FILE
88
		$SED "s?^dhcprelayagent.*?#dhcprelayagent\t\t$RELAY_DHCP_IP?g" $CHILLI_CONF_FILE
89
		$SED "s?^dhcpgatewayport.*?#dhcpgatewayport\t\t$RELAY_DHCP_PORT?g" $CHILLI_CONF_FILE
89
		$SED "s?^dhcpgatewayport.*?#dhcpgatewayport\t\t$RELAY_DHCP_PORT?g" $CHILLI_CONF_FILE
90
		$SED "s?^EXT_DHCP_IP.*?EXT_DHCP_IP=none?g" $ALCASAR_CONF_FILE
90
		$SED "s?^EXT_DHCP_IP.*?EXT_DHCP_IP=none?g" $ALCASAR_CONF_FILE
91
		$SED "s?^RELAY_DHCP_IP.*?RELAY_DHCP_IP=none?g" $ALCASAR_CONF_FILE
91
		$SED "s?^RELAY_DHCP_IP.*?RELAY_DHCP_IP=none?g" $ALCASAR_CONF_FILE
92
		$SED "s?^RELAY_DHCP_PORT.*?RELAY_DHCP_PORT=none?g" $ALCASAR_CONF_FILE
92
		$SED "s?^RELAY_DHCP_PORT.*?RELAY_DHCP_PORT=none?g" $ALCASAR_CONF_FILE
93
		/etc/init.d/chilli restart
93
		/usr/bin/systemctl restart chilli
94
		;;
94
		;;
95
	--half|-half) # enable DHCP service on half (upper) range of IP addresses
95
	--half|-half) # enable DHCP service on half (upper) range of IP addresses
96
		$SED "s?.*statip.*?statip\t\t$PRIVATE_STAT_IP?g" $CHILLI_CONF_FILE
96
		$SED "s?.*statip.*?statip\t\t$PRIVATE_STAT_IP?g" $CHILLI_CONF_FILE
97
		$SED "s?^nodynip.*?#nodynip?g" $CHILLI_CONF_FILE
97
		$SED "s?^nodynip.*?#nodynip?g" $CHILLI_CONF_FILE
98
		$SED "s?^DHCP.*?DHCP=half?g" $ALCASAR_CONF_FILE
98
		$SED "s?^DHCP.*?DHCP=half?g" $ALCASAR_CONF_FILE
Line 103... Line 103...
103
		$SED "s?^dhcprelayagent.*?#dhcprelayagent\t\t$RELAY_DHCP_IP?g" $CHILLI_CONF_FILE
103
		$SED "s?^dhcprelayagent.*?#dhcprelayagent\t\t$RELAY_DHCP_IP?g" $CHILLI_CONF_FILE
104
		$SED "s?^dhcpgatewayport.*?#dhcpgatewayport\t\t$RELAY_DHCP_PORT?g" $CHILLI_CONF_FILE
104
		$SED "s?^dhcpgatewayport.*?#dhcpgatewayport\t\t$RELAY_DHCP_PORT?g" $CHILLI_CONF_FILE
105
		$SED "s?^EXT_DHCP_IP.*?EXT_DHCP_IP=none?g" $ALCASAR_CONF_FILE
105
		$SED "s?^EXT_DHCP_IP.*?EXT_DHCP_IP=none?g" $ALCASAR_CONF_FILE
106
		$SED "s?^RELAY_DHCP_IP.*?RELAY_DHCP_IP=none?g" $ALCASAR_CONF_FILE
106
		$SED "s?^RELAY_DHCP_IP.*?RELAY_DHCP_IP=none?g" $ALCASAR_CONF_FILE
107
		$SED "s?^RELAY_DHCP_PORT.*?RELAY_DHCP_PORT=none?g" $ALCASAR_CONF_FILE
107
		$SED "s?^RELAY_DHCP_PORT.*?RELAY_DHCP_PORT=none?g" $ALCASAR_CONF_FILE
108
		/etc/init.d/chilli restart
108
		/usr/bin/systemctl restart chilli
109
		;;
109
		;;
110
	*)
110
	*)
111
		echo "Argument inconnu :$1";
111
		echo "Argument inconnu :$1";
112
		echo "$usage"
112
		echo "$usage"
113
		exit 1
113
		exit 1