Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-init
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-init
Commits
b36eb126
Commit
b36eb126
authored
Feb 07, 2017
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add default net mask
parent
cd0e9b28
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
init_elphel393.py
src/init_elphel393.py
+5
-4
No files found.
src/init_elphel393.py
View file @
b36eb126
...
@@ -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"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment