Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
S1OVS
openvpn-server
Commits
aeac5382
Commit
aeac5382
authored
Jul 06, 2021
by
Lindsay
Browse files
Update previously missed spots for client cert common name 30 char limit in fuctions.sh
parent
7568bd9a
Pipeline
#1113
passed with stage
in 19 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
functions.sh
View file @
aeac5382
...
...
@@ -41,7 +41,7 @@ if [ $COUNT -eq 0 ]; then
else
#There was something entered so lets validate OVPN_COMMONNAME
if
[
$COUNT
-gt
3
]
&&
[
$COUNT
-lt
31
]
;
then
#We have between 4 and
12
characters in the variable, lets validate they are valid
#We have between 4 and
30
characters in the variable, lets validate they are valid
if
[[
$OVPN_COMMONNAME
=
~ ^[0-9A-Za-z_]+
$
]]
;
then
COMMONNAME_VALID
=
1
#Yay! winner winner, chicken dinner
fi
...
...
@@ -55,7 +55,7 @@ fi
#If the COMMONNAME_VALID variable was not set to 1 above then we go into this loop to try again
while
[[
$COMMONNAME_VALID
!=
1
]]
;
do
echo
""
echo
"The certificate name can only consist of (4-
15
) upper or lowercase letters or numbers and _"
echo
"The certificate name can only consist of (4-
30
) upper or lowercase letters or numbers and _"
read
-p
"You entered [
$OVPN_COMMONNAME
]. Please try again: "
OVPN_COMMONNAME
COUNT
=(
$(
echo
-n
$OVPN_COMMONNAME
|
wc
-m
)
)
...
...
@@ -64,8 +64,8 @@ while [[ $COMMONNAME_VALID != 1 ]]; do
COMMONNAME_VALID
=
0
else
#There was something entered so lets validate the ORGNICK
if
[
$COUNT
-gt
3
]
&&
[
$COUNT
-lt
1
6
]
;
then
#We have between 4 and
12
characters in the variable, lets validate they are valid letters
if
[
$COUNT
-gt
3
]
&&
[
$COUNT
-lt
3
1
]
;
then
#We have between 4 and
30
characters in the variable, lets validate they are valid letters
if
[[
$OVPN_COMMONNAME
=
~ ^[0-9A-Za-z_]+
$
]]
;
then
COMMONNAME_VALID
=
1
#Yay! winner winner, chicken dinner
fi
...
...
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