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
061e4106
Commit
061e4106
authored
Jul 23, 2021
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
It's fucking working :D
parent
1a3c9514
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
fuswim
fuswim
+5
-4
No files found.
fuswim
View file @
061e4106
...
@@ -134,6 +134,7 @@ def read_netconf(net):
...
@@ -134,6 +134,7 @@ def read_netconf(net):
for
line
in
lines
:
for
line
in
lines
:
if
":"
in
line
:
if
":"
in
line
:
k
,
v
=
line
.
split
(
":"
,
1
)
k
,
v
=
line
.
split
(
":"
,
1
)
v
=
v
.
replace
(
"
\n
"
,
""
)
if
k
in
[
'auto'
,
'dhcp'
]:
if
k
in
[
'auto'
,
'dhcp'
]:
v
=
checkYN
(
v
)
v
=
checkYN
(
v
)
if
k
==
'gw'
:
if
k
==
'gw'
:
...
@@ -255,7 +256,7 @@ def insertNetwork(net):
...
@@ -255,7 +256,7 @@ def insertNetwork(net):
pwd
=
input
(
"Enter the fucking PASSWORD: "
)
pwd
=
input
(
"Enter the fucking PASSWORD: "
)
dhcp
=
checkYN
(
input
(
"Is this fucking wifi having a DHCP? <Y|n>: "
),
default
=
'Y'
)
dhcp
=
checkYN
(
input
(
"Is this fucking wifi having a DHCP? <Y|n>: "
),
default
=
'Y'
)
errnum
=
0
errnum
=
0
net
[
'conf'
][
'psk'
]
=
pwd
net
[
'conf'
][
'psk'
]
=
pwd
.
replace
(
"
\n
"
,
""
)
net
[
'conf'
][
'dhcp'
]
=
dhcp
net
[
'conf'
][
'dhcp'
]
=
dhcp
if
not
dhcp
:
if
not
dhcp
:
ip
=
None
ip
=
None
...
@@ -414,10 +415,10 @@ while not EXIT:
...
@@ -414,10 +415,10 @@ while not EXIT:
if
selected
[
'conf'
][
'dhcp'
]:
if
selected
[
'conf'
][
'dhcp'
]:
sh
(
"dhclient "
+
interface
)
sh
(
"dhclient "
+
interface
)
else
:
else
:
sh
(
"ip address add "
+
selected
[
'conf'
][
'ip'
]
+
"/"
+
netmaskToBit
(
selected
[
'conf'
][
'nmask'
])
+
" dev "
+
interface
)
sh
(
"ip address add "
+
selected
[
'conf'
][
'ip'
]
+
"/"
+
netmaskToBit
(
selected
[
'conf'
][
'nmask'
])
+
" dev "
+
interface
+
" > /dev/null 2>&1"
)
sh
(
"ip link set "
+
interface
+
" up"
)
sh
(
"ip link set "
+
interface
+
" up
> /dev/null 2>&1
"
)
if
selected
[
'conf'
][
'gw'
]:
if
selected
[
'conf'
][
'gw'
]:
sh
(
"ip route add default via "
+
selected
[
'conf'
][
'gw'
]
+
" dev "
+
interface
)
sh
(
"ip route add default via "
+
selected
[
'conf'
][
'gw'
]
+
" dev "
+
interface
+
" > /dev/null 2>&1"
)
done
=
True
done
=
True
else
:
else
:
print_error
(
"FUCK, Are you asking me to connect but you didn't select successfully any network???"
)
print_error
(
"FUCK, Are you asking me to connect but you didn't select successfully any network???"
)
...
...
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