Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
F
fuswim
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sysadmin
fuswim
Commits
a0177509
Commit
a0177509
authored
3 years ago
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fucking cycle
parent
84fc8321
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
21 deletions
+33
-21
fuswim
fuswim
+33
-21
No files found.
fuswim
View file @
a0177509
...
@@ -73,7 +73,8 @@ def read_netconf(net):
...
@@ -73,7 +73,8 @@ def read_netconf(net):
'dhcp'
:
True
,
'dhcp'
:
True
,
'ip'
:
'192.168.42.42'
,
'ip'
:
'192.168.42.42'
,
'nmask'
:
'255.255.255.0'
,
'nmask'
:
'255.255.255.0'
,
'gw'
:
'192.168.42.1'
'gw'
:
'192.168.42.1'
,
'saved'
:
False
}
}
if
os
.
path
.
isfile
(
p
):
if
os
.
path
.
isfile
(
p
):
try
:
try
:
...
@@ -85,11 +86,12 @@ def read_netconf(net):
...
@@ -85,11 +86,12 @@ def read_netconf(net):
if
k
in
[
'auto'
,
'dhcp'
]:
if
k
in
[
'auto'
,
'dhcp'
]:
v
=
checkYN
(
v
)
v
=
checkYN
(
v
)
conf
[
k
]
=
v
conf
[
k
]
=
v
conf
[
'saved'
]
=
True
return
conf
return
conf
except
:
except
:
pass
pass
return
False
return
conf
def
kill_proc
(
name
,
ops
=
False
):
def
kill_proc
(
name
,
ops
=
False
):
...
@@ -169,24 +171,34 @@ for net in netw:
...
@@ -169,24 +171,34 @@ for net in netw:
print
(
'Here it is your fucking networks...:'
)
def
show_fuck_list
(
nets
):
i
=
0
print
(
'
\n
Here it is your fucking networks...:
\n
'
)
for
net
in
nets
.
keys
():
i
=
0
netconf
=
""
netind
=
{}
sig
=
nets
[
net
][
'Signal Level'
]
for
net
in
nets
.
keys
():
qual
=
nets
[
net
][
'Quality'
]
netconf
=
""
enc
=
'Open'
sig
=
nets
[
net
][
'Signal Level'
]
if
'Encryption'
in
nets
[
net
]
.
keys
():
qual
=
nets
[
net
][
'Quality'
]
enc
=
nets
[
net
][
'Encryption'
]
enc
=
'Open'
freq
=
nets
[
net
][
'Frequency'
]
if
'Encryption'
in
nets
[
net
]
.
keys
():
nconf
=
read_netconf
(
net
)
enc
=
nets
[
net
][
'Encryption'
]
if
nconf
:
freq
=
nets
[
net
][
'Frequency'
]
nauto
=
'NO'
nconf
=
read_netconf
(
net
)
if
nconf
[
'auto'
]:
if
nconf
[
'saved'
]:
nauto
=
'YES'
nauto
=
'NO'
netconf
=
"AUTO: "
+
nauto
+
", PRIO: "
+
str
(
nconf
[
'prio'
])
if
nconf
[
'auto'
]:
nauto
=
'YES'
print
(
" "
+
str
(
i
)
+
": "
+
colors
.
BLUE
+
net
+
colors
.
ENDC
+
" ("
+
sigcol
(
qual
)
+
"sig: "
+
sig
+
", qual: "
+
qual
+
", freq: "
+
freq
+
", enc: "
+
enc
+
colors
.
ENDC
+
") "
+
netconf
)
netconf
=
"AUTO: "
+
nauto
+
", PRIO: "
+
str
(
nconf
[
'prio'
])
i
=
i
+
1
print
(
" "
+
str
(
i
)
+
": "
+
colors
.
BLUE
+
net
+
colors
.
ENDC
+
" ("
+
sigcol
(
qual
)
+
"sig: "
+
sig
+
", qual: "
+
qual
+
", freq: "
+
freq
+
", enc: "
+
enc
+
colors
.
ENDC
+
") "
+
netconf
)
netind
[
str
(
i
)]
=
nets
[
net
]
i
=
i
+
1
return
netind
netind
=
{}
fuck
=
"none"
while
fuck
not
in
netind
.
keys
()
and
fuck
.
lower
()
not
in
[
'e'
,
'R'
,
'q'
]:
netind
=
show_fuck_list
(
nets
)
fuck
=
input
(
"
\n
Choose a fucking one by index, or press E for edit, R to remove, Q to shit the hell out: "
)
This diff is collapsed.
Click to expand it.
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