From 643d10abd5835a84428330e6f740f840de67ecb8 Mon Sep 17 00:00:00 2001 From: diaodeng <108243171+diaodeng@users.noreply.github.com> Date: Sat, 5 Apr 2025 00:06:45 +0800 Subject: [PATCH] =?UTF-8?q?alpine=E7=B3=BB=E7=BB=9F=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E5=8F=8A=E8=84=9A=E6=9C=AC=EF=BC=8Calpine?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E9=BB=98=E8=AE=A4=E6=B2=A1=E6=9C=89bash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- httpsok.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/httpsok.sh b/httpsok.sh index 1cc33f8..0551fd6 100755 --- a/httpsok.sh +++ b/httpsok.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # WIKI: https://httpsok.com/doc/ # This script only supports bash, do not support posix sh. @@ -191,7 +191,11 @@ _init_params() { # user can setting if [ -z "$NGINX_CONFIG" ]; then # Use a running nginx first - NGINX_CONFIG=$(ps -eo pid,cmd | grep nginx | grep master | grep '\-c' | awk -F '-c' '{print $2}' | sed 's/ //g') + if ps -eo pid,cmd 2>&1;then + NGINX_CONFIG=$(ps -eo pid,cmd | grep nginx | grep master | grep '\-c' | awk -F '-c' '{print $2}' | sed 's/ //g') + else + NGINX_CONFIG=$(ps -e| grep nginx | grep master | grep '\-c' | awk -F '-c' '{print $2}' | sed 's/ //g') + fi fi # fix the NGINX_CONFIG equals nginx.conf bug @@ -875,7 +879,7 @@ _uninstall() { showWelcome echo "If your need install httpsok agian. Please see $HTTPSOK_HOME_URL . -curl -s $SCRIPT_URL | bash -s 'your token' +curl -s $SCRIPT_URL | /bin/sh -s 'your token' " } @@ -996,4 +1000,4 @@ main() { if _startswith "$1" '-'; then _process "$@"; else _process --setup "$@"; fi } -main "$@" \ No newline at end of file +main "$@"