Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
d4449449
Commit
d4449449
authored
Jan 27, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nginx-le.sh: don't use conf name as domain name (always use server_name)
parent
7d30401c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
nginx-le.sh
certs/nginx-le.sh
+22
-8
No files found.
certs/nginx-le.sh
View file @
d4449449
#!/bin/sh -x
DOMAIN
=
$1
shift
# run with domain or path to conf file (preferable)
[
-n
"
$DOMAIN
"
]
||
exit
INTHOST
=
host03.eterhost.ru
NCONF
=
$1
shift
if
[
-r
"
$DOMAIN
"
]
;
then
NCONF
=
"
$DOMAIN
"
DOMAIN
=
$(
basename
"
$DOMAIN
"
.conf
)
[
-n
"
$NCONF
"
]
||
exit
if
[
-r
"
$NCONF
"
]
;
then
DOMAIN
=
""
DOMAINARG
=
""
for
i
in
$(
grep
server_name
$NCONF
|
sed
-e
"s|;||"
)
;
do
echo
"
$i
"
|
grep
-q
"server_name"
&&
continue
echo
"
$i
"
|
grep
-q
"
$INTHOST
"
&&
continue
[
-n
"
$DOMAIN
"
]
||
DOMAIN
=
"
$i
"
DOMAINARG
=
"
$DOMAINARG
-d
$i
"
done
else
DOMAIN
=
"
$NCONF
"
DOMAINARG
=
"-d
$DOMAIN
"
NCONF
=
/etc/nginx/sites-enabled.d/
$DOMAIN
.conf
fi
# depends on a system
DIR
=
/var/spool/nginx/tmp/client
[
-d
"
$DIR
"
]
||
DIR
=
/var/lib/nginx/tmp/client
...
...
@@ -18,9 +33,8 @@ DIR=/var/spool/nginx/tmp/client
serv nginx reload
||
exit
letsencrypt certonly
--webroot
-w
$DIR
-d
$DOMAIN
$@
||
exit
letsencrypt certonly
--webroot
-w
$DIR
$DOMAINARG
$@
||
exit
[
-n
"
$NCONF
"
]
||
NCONF
=
/etc/nginx/sites-enabled.d/
$DOMAIN
.conf
KEY
=
/etc/letsencrypt/live/
$DOMAIN
/privkey.pem
PEM
=
/etc/letsencrypt/live/
$DOMAIN
/fullchain.pem
CHAIN
=
/etc/letsencrypt/live/
$DOMAIN
/chain.pem
...
...
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