Subversion Repositories ALCASAR

Rev

Rev 2223 | Rev 2474 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2223 Rev 2454
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-dhcp.sh 2223 2017-05-14 14:38:01Z tom.houdayer $
2
# $Id: alcasar-dhcp.sh 2454 2017-12-09 18:59:31Z tom.houdayer $
3
 
3
 
4
# alcasar-dhcp.sh
4
# alcasar-dhcp.sh
5
 
5
 
6
# by Rexy
6
# by Rexy
7
# This script is distributed under the Gnu General Public License (GPL)
7
# This script is distributed under the Gnu General Public License (GPL)
Line 52... Line 52...
52
		$SED "s?.*statip.*?statip\t\t$PRIVATE_NETWORK_MASK?g" $CHILLI_CONF_FILE
52
		$SED "s?.*statip.*?statip\t\t$PRIVATE_NETWORK_MASK?g" $CHILLI_CONF_FILE
53
		$SED "s?^#nodynip.*?nodynip?g" $CHILLI_CONF_FILE
53
		$SED "s?^#nodynip.*?nodynip?g" $CHILLI_CONF_FILE
54
		$SED "s?^dynip.*?#dynip?g" $CHILLI_CONF_FILE
54
		$SED "s?^dynip.*?#dynip?g" $CHILLI_CONF_FILE
55
		$SED "s?^#dynip.*?#dynip?g" $CHILLI_CONF_FILE
55
		$SED "s?^#dynip.*?#dynip?g" $CHILLI_CONF_FILE
56
		$SED "s?^DHCP.*?DHCP=off?g" $ALCASAR_CONF_FILE
56
		$SED "s?^DHCP.*?DHCP=off?g" $ALCASAR_CONF_FILE
57
		if [ "$EXT_DHCP_IP" != "none" ] 
57
		if [ "$EXT_DHCP_IP" != "none" ]
58
		then
58
		then
59
		      $SED "s?.*dhcpgateway\t.*?dhcpgateway\t\t $EXT_DHCP_IP?g" $CHILLI_CONF_FILE
59
			$SED "s?.*dhcpgateway\t.*?dhcpgateway\t\t $EXT_DHCP_IP?g" $CHILLI_CONF_FILE
60
		      $SED "s?.*dhcprelayagent.*?dhcprelayagent\t\t$RELAY_DHCP_IP?g" $CHILLI_CONF_FILE
60
			$SED "s?.*dhcprelayagent.*?dhcprelayagent\t\t$RELAY_DHCP_IP?g" $CHILLI_CONF_FILE
61
		      $SED "s?.*dhcpgatewayport.*?dhcpgatewayport\t\t$RELAY_DHCP_PORT?g" $CHILLI_CONF_FILE
61
			$SED "s?.*dhcpgatewayport.*?dhcpgatewayport\t\t$RELAY_DHCP_PORT?g" $CHILLI_CONF_FILE
62
		else
62
		else
63
		      $SED "s?.*dhcpgateway\t.*?#dhcpgateway\t\t$EXT_DHCP_IP?g" $CHILLI_CONF_FILE
63
			$SED "s?.*dhcpgateway\t.*?#dhcpgateway\t\t$EXT_DHCP_IP?g" $CHILLI_CONF_FILE
64
		      $SED "s?.*dhcprelayagent.*?#dhcprelayagent\t\t$RELAY_DHCP_IP?g" $CHILLI_CONF_FILE
64
			$SED "s?.*dhcprelayagent.*?#dhcprelayagent\t\t$RELAY_DHCP_IP?g" $CHILLI_CONF_FILE
65
		      $SED "s?.*dhcpgatewayport.*?#dhcpgatewayport\t\t$RELAY_DHCP_PORT?g" $CHILLI_CONF_FILE
65
			$SED "s?.*dhcpgatewayport.*?#dhcpgatewayport\t\t$RELAY_DHCP_PORT?g" $CHILLI_CONF_FILE
66
		fi
66
		fi
67
		/usr/bin/systemctl restart chilli
67
		/usr/bin/systemctl restart chilli
68
		;;
68
		;;
69
	--on|-on) # enable DHCP service on all range of IP addresses
69
	--on|-on) # enable DHCP service on all range of IP addresses
70
		$SED "s?^.*statip.*?#statip?g" $CHILLI_CONF_FILE
70
		$SED "s?^.*statip.*?#statip?g" $CHILLI_CONF_FILE