From bce90126c182968ed482fdde437c6883dfae491e Mon Sep 17 00:00:00 2001 From: fling Date: Fri, 22 Jul 2011 12:05:26 +0800 Subject: [PATCH] bug 4.3/950 check net. modified: ri_tk_cmd.py modified: ../operation/configure_network.sh --- interface/ri_tk_cmd.py | 9 +++++---- operation/configure_network.sh | 5 ----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/interface/ri_tk_cmd.py b/interface/ri_tk_cmd.py index 11a1f5e..23cdf35 100644 --- a/interface/ri_tk_cmd.py +++ b/interface/ri_tk_cmd.py @@ -138,11 +138,12 @@ def network_quit(): if not ri_data.Network.hostname: ri_widget.MessageBox.dict['check_ip_hostname'].show() + ri_widget.Sequence.previous() elif ri_data.Network.configuration == "static" and \ - (not ri_data.Network.ip or \ - not ri_data.Network.mask or \ - not ri_data.Network.gateway or \ - not ri_data.Network.primary_dns) : + (not re.match("^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$",ri_data.Network.ip) or \ + not re.match("^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$",ri_data.Network.mask) or \ + not re.match("^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$",ri_data.Network.gateway) or \ + not re.match("^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$",ri_data.Network.primary_dns)): ri_widget.MessageBox.dict['check_ip_hostname'].show() ri_widget.Sequence.previous() diff --git a/operation/configure_network.sh b/operation/configure_network.sh index 9ee0742..31fec52 100755 --- a/operation/configure_network.sh +++ b/operation/configure_network.sh @@ -175,11 +175,6 @@ parse_arg () fi if [ "$TYPE" == "static" ];then - if [ -z "$DOMAINNAME" ];then - err "static configure network, DOMAINNAME can't be empty" - return 1 - fi - if [ -z "$IP" ];then err "static configure network, IP address can't be empty" return 1