Commit b36eb126 authored by Mikhail Karpenko's avatar Mikhail Karpenko

Add default net mask

parent cd0e9b28
...@@ -42,6 +42,7 @@ import os ...@@ -42,6 +42,7 @@ import os
#params #params
SENSOR_TYPE = 5 SENSOR_TYPE = 5
IPADDR = "192.168.0.9" IPADDR = "192.168.0.9"
NETMASK = "255.255.255.0"
IMGSRV_PORT = 2323 IMGSRV_PORT = 2323
CAMOGM_PORT = 3456 CAMOGM_PORT = 3456
CAMOGM_PIPE = "/var/volatile/camogm_cmd" CAMOGM_PIPE = "/var/volatile/camogm_cmd"
...@@ -120,8 +121,8 @@ def shout(cmd): ...@@ -120,8 +121,8 @@ def shout(cmd):
#subprocess.call prints to console #subprocess.call prints to console
subprocess.call(cmd,shell=True) subprocess.call(cmd,shell=True)
def init_ipaddr(ip): def init_ipaddr(ip, mask):
shout("ifconfig eth0 "+ip) shout("ifconfig eth0 "+ip+" netmask "+mask)
def init_imgsrv(port): def init_imgsrv(port):
shout("imgsrv -p "+str(port)) shout("imgsrv -p "+str(port))
...@@ -240,8 +241,8 @@ else: ...@@ -240,8 +241,8 @@ else:
#1 #1
if switch['ip']==1: if switch['ip']==1:
log_msg(sys.argv[0]+": ip = "+IPADDR) log_msg(sys.argv[0]+": ip = "+IPADDR+", mask = "+NETMASK)
init_ipaddr(IPADDR) init_ipaddr(IPADDR, NETMASK)
else: else:
log_msg("skip ip") log_msg("skip ip")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment