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
96ecfd54
Commit
96ecfd54
authored
Jul 31, 2021
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added changelog and pre/post up scripts
parent
6b223506
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
CHANGELOG.txt
CHANGELOG.txt
+3
-0
MAYBETODO.txt
MAYBETODO.txt
+0
-1
fuswim
fuswim
+12
-1
No files found.
CHANGELOG.txt
0 → 100644
View file @
96ecfd54
= Sat 31 Jul 2021 11:57:57 SAST =
- Added support for preup and postup external scripts
MAYBETODO.txt
View file @
96ecfd54
...
@@ -9,7 +9,6 @@ Or you can bulling me to do it. Good luck with that.
...
@@ -9,7 +9,6 @@ Or you can bulling me to do it. Good luck with that.
- "polite" mode, with less rudeness in the messages ( if enough or reasonable requests to do it will arrive )
- "polite" mode, with less rudeness in the messages ( if enough or reasonable requests to do it will arrive )
- better managing of key-mgmnt modes
- better managing of key-mgmnt modes
- support ad-hoc connections
- support ad-hoc connections
- preup, postup custom external script
- checking the outcome of the connection.
- checking the outcome of the connection.
- better config parser/format.
- better config parser/format.
- better command line arguments parsing.
- better command line arguments parsing.
...
...
fuswim
View file @
96ecfd54
...
@@ -168,6 +168,8 @@ def read_netconf(net):
...
@@ -168,6 +168,8 @@ def read_netconf(net):
'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'
,
'preup'
:
False
,
'postup'
:
False
,
'saved'
:
False
'saved'
:
False
}
}
if
os
.
path
.
isfile
(
p
):
if
os
.
path
.
isfile
(
p
):
...
@@ -180,6 +182,9 @@ def read_netconf(net):
...
@@ -180,6 +182,9 @@ def read_netconf(net):
v
=
v
.
replace
(
"
\n
"
,
""
)
v
=
v
.
replace
(
"
\n
"
,
""
)
if
k
in
[
'auto'
,
'dhcp'
]:
if
k
in
[
'auto'
,
'dhcp'
]:
v
=
checkYN
(
v
)
v
=
checkYN
(
v
)
if
k
in
[
'preup'
,
'postup'
]:
if
not
os
.
path
.
isfile
(
v
):
v
=
False
if
k
==
'gw'
:
if
k
==
'gw'
:
if
not
validateIP
(
v
):
if
not
validateIP
(
v
):
v
=
checkYN
(
v
)
v
=
checkYN
(
v
)
...
@@ -208,6 +213,9 @@ def write_netconf(net, nconf):
...
@@ -208,6 +213,9 @@ def write_netconf(net, nconf):
if
nconf
[
k
]:
if
nconf
[
k
]:
v
=
'y'
v
=
'y'
f
.
write
(
k
+
':'
+
v
+
'
\n
'
)
f
.
write
(
k
+
':'
+
v
+
'
\n
'
)
elif
k
in
[
'preup'
,
'postup'
]:
if
not
v
:
f
.
write
(
k
+
':n
\n
'
)
else
:
else
:
f
.
write
(
k
+
':'
+
str
(
nconf
[
k
])
+
'
\n
'
)
f
.
write
(
k
+
':'
+
str
(
nconf
[
k
])
+
'
\n
'
)
f
.
close
()
f
.
close
()
...
@@ -457,6 +465,8 @@ while not EXIT:
...
@@ -457,6 +465,8 @@ while not EXIT:
elif
SM
==
"connect"
:
elif
SM
==
"connect"
:
done
=
False
done
=
False
if
selected
:
if
selected
:
if
selected
[
'conf'
][
'preup'
]:
sh
(
'export WLAN="'
+
interface
+
'" && export WNAME="'
+
selected
[
'Name'
]
+
'" && '
+
selected
[
'conf'
][
'preup'
]
+
' preup'
)
cfile
=
'/tmp/wpa.'
+
interface
+
'.conf'
cfile
=
'/tmp/wpa.'
+
interface
+
'.conf'
create_wpacfile
(
cfile
,
selected
)
create_wpacfile
(
cfile
,
selected
)
start_wpa
(
interface
,
cfile
)
start_wpa
(
interface
,
cfile
)
...
@@ -472,7 +482,8 @@ while not EXIT:
...
@@ -472,7 +482,8 @@ while not EXIT:
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???"
)
if
done
:
if
done
:
# TODO launch here a post-connect external script?
if
selected
[
'conf'
][
'postup'
]:
sh
(
'export WLAN="'
+
interface
+
'" && export WNAME="'
+
selected
[
'Name'
]
+
'" && '
+
selected
[
'conf'
][
'postup'
]
+
' postup'
)
print
(
colors
.
BCYAN
+
"
\n
Are we fucking connected? Up to you to check, do something for fuck sake!
\n
"
+
colors
.
ENDC
)
print
(
colors
.
BCYAN
+
"
\n
Are we fucking connected? Up to you to check, do something for fuck sake!
\n
"
+
colors
.
ENDC
)
if
boot
:
if
boot
:
if
done
:
if
done
:
...
...
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