Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSiUX
rap
Commits
2ec663a7
Commit
2ec663a7
authored
3 years ago
by
fauno
Browse files
Options
Downloads
Patches
Plain Diff
no hardcodear el nombre de la red
parent
b67c5be3
No related branches found
No related tags found
Loading
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/exec/status
+10
-10
10 additions, 10 deletions
lib/exec/status
with
10 additions
and
10 deletions
lib/exec/status
+
10
−
10
View file @
2ec663a7
...
@@ -62,14 +62,14 @@ fi
...
@@ -62,14 +62,14 @@ fi
# Servicio de tinc@rap (si existe el principal)
# Servicio de tinc@rap (si existe el principal)
if
[
"
${
notincsv
}
"
!=
true
]
;
then
if
[
"
${
notincsv
}
"
!=
true
]
;
then
tincrapsvstatus
=
"
$(
systemctl status tinc@
rap
||
:
)
"
tincrapsvstatus
=
"
$(
systemctl status tinc@
${
NETWORK
}
||
:
)
"
if
[
-z
"
${
tincrapsvstatus
}
"
]
;
then
if
[
-z
"
${
tincrapsvstatus
}
"
]
;
then
msg_orange
"No se encontró el servicio de tinc@
rap
"
msg_orange
"No se encontró el servicio de tinc@
${
NETWORK
}
"
else
else
tincsv
=
"
$(
systemctl show tinc@
rap
)
"
tincsv
=
"
$(
systemctl show tinc@
${
NETWORK
}
)
"
echo
"
${
tincsv
}
"
|
grep
-q
UnitFileState
=
enabled
&&
enabled
=
si
||
enabled
=
no
echo
"
${
tincsv
}
"
|
grep
-q
UnitFileState
=
enabled
&&
enabled
=
si
||
enabled
=
no
echo
"
${
tincsv
}
"
|
grep
-q
ActiveState
=
active
&&
active
=
si
||
active
=
no
echo
"
${
tincsv
}
"
|
grep
-q
ActiveState
=
active
&&
active
=
si
||
active
=
no
msgtxt
=
"Se encontró el servicio de tinc@
rap
: inicio en arranque=
${
enabled
}
, activo ahora=
${
active
}
"
msgtxt
=
"Se encontró el servicio de tinc@
${
NETWORK
}
: inicio en arranque=
${
enabled
}
, activo ahora=
${
active
}
"
if
[
"
${
active
}
"
=
si
]
;
then
msg
"
${
msgtxt
}
"
if
[
"
${
active
}
"
=
si
]
;
then
msg
"
${
msgtxt
}
"
else
msg_orange
"
${
msgtxt
}
"
;
fi
else
msg_orange
"
${
msgtxt
}
"
;
fi
fi
fi
...
@@ -78,25 +78,25 @@ fi
...
@@ -78,25 +78,25 @@ fi
# Interface de red
# Interface de red
iplink
=
"
$(
ip
link
show
"
${
NETWORK
}
"
2>/dev/null
||
:
)
"
iplink
=
"
$(
ip
link
show
"
${
NETWORK
}
"
2>/dev/null
||
:
)
"
if
[
-z
"
${
iplink
}
"
]
;
then
if
[
-z
"
${
iplink
}
"
]
;
then
msg_orange
"No se encontró la interface de red de la
rap
"
msg_orange
"No se encontró la interface de red de la
${
NETWORK
}
"
else
else
echo
"
${
iplink
}
"
|
grep
-q
'state UNKNOWN'
&&
interface
=
true
||
interface
=
false
echo
"
${
iplink
}
"
|
grep
-q
'state UNKNOWN'
&&
interface
=
true
||
interface
=
false
if
[
"
${
interface
}
"
!=
true
]
;
then
if
[
"
${
interface
}
"
!=
true
]
;
then
msg_orange
"Interface de red de la
rap
encontrada, pero caída"
msg_orange
"Interface de red de la
${
NETWORK
}
encontrada, pero caída"
else
else
msg
"Interface de red de la
rap
encontrada y andando"
msg
"Interface de red de la
${
NETWORK
}
encontrada y andando"
# IPv6 local
# IPv6 local
ipaddress
=
"
$(
ip address show
"
${
NETWORK
}
"
|
grep
inet6 |
tr
-s
' '
|
cut
-d
' '
-f3
)
"
ipaddress
=
"
$(
ip address show
"
${
NETWORK
}
"
|
grep
inet6 |
tr
-s
' '
|
cut
-d
' '
-f3
)
"
if
[
-z
"
${
ipaddress
}
"
]
;
then
if
[
-z
"
${
ipaddress
}
"
]
;
then
msg_orange
"No se encontró ninguna IP de
rap
"
msg_orange
"No se encontró ninguna IP de
${
NETWORK
}
"
elif
[
"
$(
echo
"
${
ipaddress
}
"
|
wc
-l
)
"
-eq
1
]
;
then
elif
[
"
$(
echo
"
${
ipaddress
}
"
|
wc
-l
)
"
-eq
1
]
;
then
msg_orange
"Se encontró una sola IP:
${
ipaddress
}
"
msg_orange
"Se encontró una sola IP:
${
ipaddress
}
"
else
else
iprap
=
"
$(
echo
"
${
ipaddress
}
"
|
grep
"
${
ULA_PREFIX
}
"
||
:
)
"
iprap
=
"
$(
echo
"
${
ipaddress
}
"
|
grep
"
${
ULA_PREFIX
}
"
||
:
)
"
if
[
-z
"
${
iprap
}
"
]
;
then
if
[
-z
"
${
iprap
}
"
]
;
then
msg_orange
"Se encontraron varias IPs de
rap
, pero ninguna válida"
msg_orange
"Se encontraron varias IPs de
${
NETWORK
}
, pero ninguna válida"
else
else
msg
"Tu IP de
rap
es:
${
iprap
}
"
msg
"Tu IP de
${
NETWORK
}
es:
${
iprap
}
"
fi
fi
fi
fi
fi
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment