mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-05-05 23:24:54 +00:00
Check for shfmt -w -i 2 plex.sh
This commit is contained in:
parent
b2be1eb278
commit
238cd4bc5d
@ -8,9 +8,8 @@
|
|||||||
|
|
||||||
#returns 0 means success, otherwise error.
|
#returns 0 means success, otherwise error.
|
||||||
|
|
||||||
|
|
||||||
# Settings for Plex Media Server:
|
# Settings for Plex Media Server:
|
||||||
#
|
#
|
||||||
# PLEX_PKCS12_password -- Password for the PKCS file. Required by plex
|
# PLEX_PKCS12_password -- Password for the PKCS file. Required by plex
|
||||||
# PLEX_PKCS12_file -- Full PKCS file location, otherwise defaults to placing with the other certs in that domain with a pfx extension
|
# PLEX_PKCS12_file -- Full PKCS file location, otherwise defaults to placing with the other certs in that domain with a pfx extension
|
||||||
# PLEX_sudo_required -- 1 = True, 0 = False. You may need to add "plex ALL=(ALL) NOPASSWD:/bin/systemctl restart plexmediaserver.service" to your sudo'ers file
|
# PLEX_sudo_required -- 1 = True, 0 = False. You may need to add "plex ALL=(ALL) NOPASSWD:/bin/systemctl restart plexmediaserver.service" to your sudo'ers file
|
||||||
@ -34,46 +33,44 @@ plex_deploy() {
|
|||||||
_getdeployconf PLEX_PKCS12_password
|
_getdeployconf PLEX_PKCS12_password
|
||||||
_getdeployconf PLEX_PKCS12_file
|
_getdeployconf PLEX_PKCS12_file
|
||||||
_getdeployconf PLEX_sudo_required
|
_getdeployconf PLEX_sudo_required
|
||||||
|
|
||||||
|
|
||||||
#_DEPLOY_PLEX_WIKI="https://github.com/acmesh-official/acme.sh/wiki/deploy-to-plex"
|
#_DEPLOY_PLEX_WIKI="https://github.com/acmesh-official/acme.sh/wiki/deploy-to-plex"
|
||||||
|
|
||||||
|
|
||||||
if [ -z "$PLEX_PKCS12_password" ]; then
|
if [ -z "$PLEX_PKCS12_password" ]; then
|
||||||
_err "The PLEX_PKCS12_password variable is not defined. Plex requires a password for the certificate."
|
_err "The PLEX_PKCS12_password variable is not defined. Plex requires a password for the certificate."
|
||||||
#_err "See: $_DEPLOY_PLEX_WIKI"
|
#_err "See: $_DEPLOY_PLEX_WIKI"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
_debug2 PLEX_PKCS12_password "$PLEX_PKCS12_password"
|
_debug2 PLEX_PKCS12_password "$PLEX_PKCS12_password"
|
||||||
|
|
||||||
if [ -z "$PLEX_PKCS12_file" ]; then
|
if [ -z "$PLEX_PKCS12_file" ]; then
|
||||||
PLEX_PKCS12_file="$DOMAIN_PATH/$_cdomain.pfx"
|
PLEX_PKCS12_file="$DOMAIN_PATH/$_cdomain.pfx"
|
||||||
_debug2 "Setting PLEX_PKCS12_file to default"
|
_debug2 "Setting PLEX_PKCS12_file to default"
|
||||||
fi
|
fi
|
||||||
_debug2 PLEX_PKCS12_file "$PLEX_PKCS12_file"
|
_debug2 PLEX_PKCS12_file "$PLEX_PKCS12_file"
|
||||||
|
|
||||||
if [ -z "$PLEX_sudo_required" ]; then
|
if [ -z "$PLEX_sudo_required" ]; then
|
||||||
PLEX_sudo_required=0
|
PLEX_sudo_required=0
|
||||||
_debug2 "Setting PLEX_PKCS12_file to default (0/False)"
|
_debug2 "Setting PLEX_PKCS12_file to default (0/False)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_debug2 PLEX_sudo_required "$PLEX_sudo_required"
|
_debug2 PLEX_sudo_required "$PLEX_sudo_required"
|
||||||
|
|
||||||
_reload_cmd=""
|
_reload_cmd=""
|
||||||
|
|
||||||
_debug "Generate import pkcs12"
|
_debug "Generate import pkcs12"
|
||||||
|
|
||||||
if ! _toPkcs "$PLEX_PKCS12_file" "$_ckey" "$_ccert" "$_cca" "$PLEX_PKCS12_password"; then
|
if ! _toPkcs "$PLEX_PKCS12_file" "$_ckey" "$_ccert" "$_cca" "$PLEX_PKCS12_password"; then
|
||||||
_err "Error generating pkcs12. Please re-run with --debug and report a bug."
|
_err "Error generating pkcs12. Please re-run with --debug and report a bug."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if systemctl -q is-active plexmediaserver; then
|
if systemctl -q is-active plexmediaserver; then
|
||||||
_debug2 "Plex is active. Restarting..."
|
_debug2 "Plex is active. Restarting..."
|
||||||
if [ -z "$PLEX_sudo_required" ]; then
|
if [ -z "$PLEX_sudo_required" ]; then
|
||||||
_reload_cmd="systemctl restart plexmediaserver.service"
|
_reload_cmd="systemctl restart plexmediaserver.service"
|
||||||
else
|
else
|
||||||
_reload_cmd="sudo systemctl restart plexmediaserver.service"
|
_reload_cmd="sudo systemctl restart plexmediaserver.service"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ -z "$_reload_cmd" ]; then
|
if [ -z "$_reload_cmd" ]; then
|
||||||
@ -86,10 +83,10 @@ plex_deploy() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_services_updated="${_services_updated} plexmediaserver"
|
_services_updated="${_services_updated} plexmediaserver"
|
||||||
_info "Install Plex Media Server certificate success!"
|
_info "Install Plex Media Server certificate success!"
|
||||||
|
|
||||||
# Successful, so save all (non-default) config:
|
# Successful, so save all (non-default) config:
|
||||||
_savedeployconf PLEX_PKCS12_password "$PLEX_PKCS12_password"
|
_savedeployconf PLEX_PKCS12_password "$PLEX_PKCS12_password"
|
||||||
_savedeployconf PLEX_PKCS12_file "$PLEX_PKCS12_file"
|
_savedeployconf PLEX_PKCS12_file "$PLEX_PKCS12_file"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user