Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
adc2018-system
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
adc2018
adc2018-system
Commits
12e539c5
Commit
12e539c5
authored
Aug 10, 2018
by
Kento HASEGAWA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't run as a general user (#5 fixed)
parent
55491c32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
main.py
comm/client/main.py
+5
-0
No files found.
comm/client/main.py
View file @
12e539c5
...
@@ -106,6 +106,11 @@ def before_request():
...
@@ -106,6 +106,11 @@ def before_request():
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
# Check if this script runs as "root" user
if
os
.
getuid
()
!=
0
:
raise
Exception
(
"Must run as root"
)
sys
.
exit
(
1
)
parser
=
argparse
.
ArgumentParser
(
description
=
"PYNQ client."
)
parser
=
argparse
.
ArgumentParser
(
description
=
"PYNQ client."
)
parser
.
add_argument
(
"-p"
,
"--port"
,
action
=
"store"
,
type
=
int
,
default
=
5000
,
help
=
"Port"
)
parser
.
add_argument
(
"-p"
,
"--port"
,
action
=
"store"
,
type
=
int
,
default
=
5000
,
help
=
"Port"
)
parser
.
add_argument
(
"-H"
,
"--host"
,
action
=
"store"
,
type
=
str
,
default
=
"192.168.4.1:5000"
,
help
=
"Host address"
)
parser
.
add_argument
(
"-H"
,
"--host"
,
action
=
"store"
,
type
=
str
,
default
=
"192.168.4.1:5000"
,
help
=
"Host address"
)
...
...
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