File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 216216 msg_ok " Initialized Backend"
217217
218218 msg_info " Starting Services"
219+ CERTBOT_VER=$( /opt/certbot/bin/certbot --version 2>&1 | awk ' {print $NF}' )
220+ if grep -q " Environment=CERTBOT_VERSION" /lib/systemd/system/npm.service; then
221+ sed -i " s|Environment=CERTBOT_VERSION=.*|Environment=CERTBOT_VERSION=${CERTBOT_VER} |" /lib/systemd/system/npm.service
222+ else
223+ sed -i " /Environment=NODE_ENV=production/a Environment=CERTBOT_VERSION=${CERTBOT_VER} " /lib/systemd/system/npm.service
224+ fi
219225 sed -i ' s/user npm/user root/g; s/^pid/#pid/g' /usr/local/openresty/nginx/conf/nginx.conf
220226 sed -r -i ' s/^([[:space:]]*)su npm npm/\1#su npm npm/g;' /etc/logrotate.d/nginx-proxy-manager
221227 systemctl daemon-reload
Original file line number Diff line number Diff line change @@ -160,7 +160,8 @@ $STD yarn install --network-timeout 600000
160160msg_ok " Initialized Backend"
161161
162162msg_info " Creating Service"
163- cat << 'EOF ' >/lib/systemd/system/npm.service
163+ CERTBOT_VER=$( /opt/certbot/bin/certbot --version 2>&1 | awk ' {print $NF}' )
164+ cat << EOF >/lib/systemd/system/npm.service
164165[Unit]
165166Description=Nginx Proxy Manager
166167After=network.target
@@ -169,6 +170,7 @@ Wants=openresty.service
169170[Service]
170171Type=simple
171172Environment=NODE_ENV=production
173+ Environment=CERTBOT_VERSION=${CERTBOT_VER}
172174ExecStartPre=-mkdir -p /tmp/nginx/body /data/letsencrypt-acme-challenge
173175ExecStart=/usr/bin/node index.js --abort_on_uncaught_exception --max_old_space_size=250
174176WorkingDirectory=/app
You can’t perform that action at this time.
0 commit comments