Support setting multicast address. Be more flexible WRT rebooting/halting the system.

From: Michael Prokop <mprokop@sipwise.com>
ksolomko/vlan
Michael Prokop 14 years ago
parent 8c816ac12e
commit d02ee852f0

@ -161,11 +161,11 @@ Usage examples:
# netcardconfig # configure eth0 with static configuration # netcardconfig # configure eth0 with static configuration
# ngcp-deployment ngcppro ngcpsp1 ngcpip1=192.168.1.101 \\ # ngcp-deployment ngcppro ngcpsp1 ngcpip1=192.168.1.101 \\
ngcpip2=192.168.1.102 ngcpeaddr=192.168.1.103 ngcpeiface=b0 ngcpip2=192.168.1.102 ngcpeaddr=192.168.1.103 ngcpeiface=b0 ngcpmcast=226.94.1.1
# netcardconfig # configure eth0 with static configuration # netcardconfig # configure eth0 with static configuration
# ngcp-deployment ngcppro ngcpsp2 ngcpip1=192.168.1.101 \\ # ngcp-deployment ngcppro ngcpsp2 ngcpip1=192.168.1.101 \\
ngcpip2=192.168.1.102 ngcpeaddr=192.168.1.103 ngcpeiface=b0 ngcpip2=192.168.1.102 ngcpeaddr=192.168.1.103 ngcpeiface=b0 ngcpmcast=226.94.1.1
" "
} }
@ -186,6 +186,7 @@ for param in $* ; do
*ngcpeaddr=*) export EADDR=$(echo $param | sed 's/ngcpeaddr=//');; *ngcpeaddr=*) export EADDR=$(echo $param | sed 's/ngcpeaddr=//');;
*ngcpip1=*) export IP1=$(echo $param | sed 's/ngcpip1=//');; *ngcpip1=*) export IP1=$(echo $param | sed 's/ngcpip1=//');;
*ngcpip2=*) export IP2=$(echo $param | sed 's/ngcpip2=//');; *ngcpip2=*) export IP2=$(echo $param | sed 's/ngcpip2=//');;
*ngcpmcast=*) export MCASTADDR=$(echo $param | sed 's/ngcpmcast=//');;
*ngcpnw.dhcp*) export DHCP=true;; *ngcpnw.dhcp*) export DHCP=true;;
esac esac
shift shift
@ -209,6 +210,7 @@ echo "Deployment Settings:
1st host IP: $IP1 1st host IP: $IP1
2nd host IP: $IP2 2nd host IP: $IP2
Ext host IP: $EADDR Ext host IP: $EADDR
Multicast addr: $MCASTADDR
Network iface: $EIFACE Network iface: $EIFACE
Use DHCP in host: $DHCP Use DHCP in host: $DHCP
@ -506,12 +508,13 @@ if $NGCP_INSTALLER ; then
[ -n "$IP2" ] || export IP2=192.168.1.102 [ -n "$IP2" ] || export IP2=192.168.1.102
[ -n "$EADDR" ] || export EADDR=192.168.1.103 [ -n "$EADDR" ] || export EADDR=192.168.1.103
[ -n "$EIFACE" ] || export EIFACE=b0 [ -n "$EIFACE" ] || export EIFACE=b0
[ -n "$MCASTADDR" ] || export MCASTADDR=226.94.1.1
cat << EOT | grml-chroot $TARGET /bin/bash cat << EOT | grml-chroot $TARGET /bin/bash
PKG=ngcp-installer-latest.deb PKG=ngcp-installer-latest.deb
wget http://deb.sipwise.com/sppro/\$PKG wget http://deb.sipwise.com/sppro/\$PKG
dpkg -i \$PKG dpkg -i \$PKG
ngcp-installer \$ROLE \$IP1 \$IP2 \$EADDR \$EIFACE ngcp-installer \$ROLE \$IP1 \$IP2 \$EADDR \$EIFACE \$MCASTADDR
RC=\$? RC=\$?
if [ \$RC -ne 0 ] ; then if [ \$RC -ne 0 ] ; then
echo "Fatal error while running ngcp-installer:" >&2 echo "Fatal error while running ngcp-installer:" >&2
@ -729,14 +732,19 @@ to boot from hard disk by default or
to boot from USB storage by default." to boot from USB storage by default."
fi fi
echo "Do you want to halt the system now? Y/n" echo "Do you want to [r]eboot or [h]alt the system now? (Press any other key to cancel.)"
unset a unset a
read a read a
case "$a" in case "$a" in
*n*|*N*) r)
echo "Not halting system as requested. Please do not forget to shut down." echo "Rebooting system as requested."
# reboot is for losers
for key in s u r ; do
echo $key > /proc/sysrq-trigger
sleep 2
done
;; ;;
*) h)
echo "Halting system as requested." echo "Halting system as requested."
# halt(8) is for losers # halt(8) is for losers
for key in s u o ; do for key in s u o ; do
@ -744,6 +752,9 @@ case "$a" in
sleep 2 sleep 2
done done
;; ;;
*)
echo "Not halting system as requested. Please do not forget to reboot."
;;
esac esac
## END OF FILE #################################################################1 ## END OF FILE #################################################################1

Loading…
Cancel
Save