Subversion Repositories ALCASAR

Rev

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

Rev 967 Rev 990
Line 1... Line 1...
1
#/bin/bash
1
#/bin/bash
2
# $Id: alcasar-dhcp.sh 967 2012-08-02 20:37:45Z franck $
2
# $Id: alcasar-dhcp.sh 990 2012-08-24 22:47:27Z franck $
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 63... Line 63...
63
		$SED "s?.*statip.*?statip\t\t$PRIVATE_NETWORK_MASK?g" $CHILLI_CONF_FILE
63
		$SED "s?.*statip.*?statip\t\t$PRIVATE_NETWORK_MASK?g" $CHILLI_CONF_FILE
64
		$SED "s?^#nodynip.*?nodynip?g" $CHILLI_CONF_FILE
64
		$SED "s?^#nodynip.*?nodynip?g" $CHILLI_CONF_FILE
65
		$SED "s?^dynip.*?#dynip?g" $CHILLI_CONF_FILE
65
		$SED "s?^dynip.*?#dynip?g" $CHILLI_CONF_FILE
66
		$SED "s?^#dynip.*?#dynip?g" $CHILLI_CONF_FILE
66
		$SED "s?^#dynip.*?#dynip?g" $CHILLI_CONF_FILE
67
		$SED "s?^DHCP.*?DHCP=off?g" $ALCASAR_CONF_FILE
67
		$SED "s?^DHCP.*?DHCP=off?g" $ALCASAR_CONF_FILE
68
		if [ $EXT_DHCP_IP ! = "none" ] 
68
		if [ $EXT_DHCP_IP != "none" ] 
69
		then
69
		then
70
		      $SED "s?.*dhcpgateway.*?dhcpgateway\t\t$EXT_DHCP_IP?g" $CHILLI_CONF_FILE
70
		      $SED "s?.*dhcpgateway .*?dhcpgateway \t\t$EXT_DHCP_IP?g" $CHILLI_CONF_FILE
71
		      $SED "s?.*dhcprelayagent.*?dhcprelayagent\t\t$RELAY_DHCP_IP?g" $CHILLI_CONF_FILE
71
		      $SED "s?.*dhcprelayagent.*?dhcprelayagent\t\t$RELAY_DHCP_IP?g" $CHILLI_CONF_FILE
72
		      $SED "s?.*dhcpgatewayport.*?#dhcpgatewayport\t\t$RELAY_DHCP_PORT?g" $CHILLI_CONF_FILE
72
		      $SED "s?.*dhcpgatewayport.*?#dhcpgatewayport\t\t$RELAY_DHCP_PORT?g" $CHILLI_CONF_FILE
73
		fi
73
		fi
74
		/etc/init.d/chilli restart
74
		/etc/init.d/chilli restart
75
		;;
75
		;;
Line 78... Line 78...
78
		$SED "s?^nodynip.*?#nodynip?g" $CHILLI_CONF_FILE
78
		$SED "s?^nodynip.*?#nodynip?g" $CHILLI_CONF_FILE
79
		$SED "s?^DHCP.*?DHCP=full?g" $ALCASAR_CONF_FILE
79
		$SED "s?^DHCP.*?DHCP=full?g" $ALCASAR_CONF_FILE
80
		$SED "s?^dynip.*?dynip\t\t$PRIVATE_NETWORK_MASK?g" $CHILLI_CONF_FILE
80
		$SED "s?^dynip.*?dynip\t\t$PRIVATE_NETWORK_MASK?g" $CHILLI_CONF_FILE
81
		$SED "s?^#dynip.*?dynip\t\t$PRIVATE_NETWORK_MASK?g" $CHILLI_CONF_FILE
81
		$SED "s?^#dynip.*?dynip\t\t$PRIVATE_NETWORK_MASK?g" $CHILLI_CONF_FILE
82
		$SED "s?^dhcp_range.*?dhcp-range=$PRIVATE_FIRST_IP,$PRIVATE_LAST_IP,$PRIVATE_NETMASK,12h?g" $DNSMASQ_CONF_FILE
82
		$SED "s?^dhcp_range.*?dhcp-range=$PRIVATE_FIRST_IP,$PRIVATE_LAST_IP,$PRIVATE_NETMASK,12h?g" $DNSMASQ_CONF_FILE
83
		$SED "s?^dhcpgateway.*?#dhcpgateway\t\t$EXT_DHCP_IP?g" $CHILLI_CONF_FILE
83
		$SED "s?^dhcpgateway .*?#dhcpgateway \t\t$EXT_DHCP_IP?g" $CHILLI_CONF_FILE
84
		$SED "s?^dhcprelayagent.*?#dhcprelayagent\t\t$RELAY_DHCP_IP?g" $CHILLI_CONF_FILE
84
		$SED "s?^dhcprelayagent.*?#dhcprelayagent\t\t$RELAY_DHCP_IP?g" $CHILLI_CONF_FILE
85
		$SED "s?^dhcpgatewayport.*?#dhcpgatewayport\t\t$RELAY_DHCP_PORT?g" $CHILLI_CONF_FILE
85
		$SED "s?^dhcpgatewayport.*?#dhcpgatewayport\t\t$RELAY_DHCP_PORT?g" $CHILLI_CONF_FILE
86
		$SED "s?^EXT_DHCP_IP.*?EXT_DHCP_IP=none?g" $ALCASAR_CONF_FILE
86
		$SED "s?^EXT_DHCP_IP.*?EXT_DHCP_IP=none?g" $ALCASAR_CONF_FILE
87
		$SED "s?^RELAY_DHCP_IP.*?RELAY_DHCP_IP=none?g" $ALCASAR_CONF_FILE
87
		$SED "s?^RELAY_DHCP_IP.*?RELAY_DHCP_IP=none?g" $ALCASAR_CONF_FILE
88
		$SED "s?^RELAY_DHCP_PORT.*?RELAY_DHCP_PORT=none?g" $ALCASAR_CONF_FILE
88
		$SED "s?^RELAY_DHCP_PORT.*?RELAY_DHCP_PORT=none?g" $ALCASAR_CONF_FILE
Line 93... Line 93...
93
		$SED "s?^nodynip.*?#nodynip?g" $CHILLI_CONF_FILE
93
		$SED "s?^nodynip.*?#nodynip?g" $CHILLI_CONF_FILE
94
		$SED "s?^DHCP.*?DHCP=half?g" $ALCASAR_CONF_FILE
94
		$SED "s?^DHCP.*?DHCP=half?g" $ALCASAR_CONF_FILE
95
		$SED "s?^dynip.*?dynip\t\t$PRIVATE_DYN_IP?g" $CHILLI_CONF_FILE
95
		$SED "s?^dynip.*?dynip\t\t$PRIVATE_DYN_IP?g" $CHILLI_CONF_FILE
96
		$SED "s?^#dynip.*?dynip\t\t$PRIVATE_DYN_IP?g" $CHILLI_CONF_FILE
96
		$SED "s?^#dynip.*?dynip\t\t$PRIVATE_DYN_IP?g" $CHILLI_CONF_FILE
97
		$SED "s?^dhcp_range.*?dhcp-range=$PRIVATE_DYN_FIRST_IP,$PRIVATE_DYN_LAST_IP,$PRIVATE_NETMASK,12h?g" $DNSMASQ_CONF_FILE
97
		$SED "s?^dhcp_range.*?dhcp-range=$PRIVATE_DYN_FIRST_IP,$PRIVATE_DYN_LAST_IP,$PRIVATE_NETMASK,12h?g" $DNSMASQ_CONF_FILE
98
		$SED "s?^dhcpgateway.*?#dhcpgateway\t\t$EXT_DHCP_IP?g" $CHILLI_CONF_FILE
98
		$SED "s?^dhcpgateway .*?#dhcpgateway \t\t$EXT_DHCP_IP?g" $CHILLI_CONF_FILE
99
		$SED "s?^dhcprelayagent.*?#dhcprelayagent\t\t$RELAY_DHCP_IP?g" $CHILLI_CONF_FILE
99
		$SED "s?^dhcprelayagent.*?#dhcprelayagent\t\t$RELAY_DHCP_IP?g" $CHILLI_CONF_FILE
100
		$SED "s?^dhcpgatewayport.*?#dhcpgatewayport\t\t$RELAY_DHCP_PORT?g" $CHILLI_CONF_FILE
100
		$SED "s?^dhcpgatewayport.*?#dhcpgatewayport\t\t$RELAY_DHCP_PORT?g" $CHILLI_CONF_FILE
101
		$SED "s?^EXT_DHCP_IP.*?EXT_DHCP_IP=none?g" $ALCASAR_CONF_FILE
101
		$SED "s?^EXT_DHCP_IP.*?EXT_DHCP_IP=none?g" $ALCASAR_CONF_FILE
102
		$SED "s?^RELAY_DHCP_IP.*?RELAY_DHCP_IP=none?g" $ALCASAR_CONF_FILE
102
		$SED "s?^RELAY_DHCP_IP.*?RELAY_DHCP_IP=none?g" $ALCASAR_CONF_FILE
103
		$SED "s?^RELAY_DHCP_PORT.*?RELAY_DHCP_PORT=none?g" $ALCASAR_CONF_FILE
103
		$SED "s?^RELAY_DHCP_PORT.*?RELAY_DHCP_PORT=none?g" $ALCASAR_CONF_FILE