From d9fe8278da1bb075f5a21467caa6d60974e195af Mon Sep 17 00:00:00 2001 From: papadave66 Date: Tue, 1 Sep 2020 23:14:07 +0800 Subject: [PATCH] FreeBSD detection and FreeBSD ps(1) compatibility fix --- release/install-tr-control-cn.sh | 8 ++++++-- release/install-tr-control.sh | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/release/install-tr-control-cn.sh b/release/install-tr-control-cn.sh index 6b93c64..5907418 100644 --- a/release/install-tr-control-cn.sh +++ b/release/install-tr-control-cn.sh @@ -403,10 +403,14 @@ getTransmissionPath() { if [ -f "/etc/fedora-release" ] || [ -f "/etc/debian_version" ]; then ROOT_FOLDER="/usr/share/transmission" fi + + if [ -f "/bin/freebsd-version" ]; then + ROOT_FOLDER="/usr/local/share/transmission" + fi if [ ! -d "$ROOT_FOLDER" ]; then showLog "$MSG_FIND_WEB_FOLDER_FROM_PROCESS" "n" - infos=`ps -ef | awk '/[t]ransmission-da/{print $8}'` + infos=`ps -Aww -o command= | sed -r -e '/[t]ransmission-da/!d' -e 's/ .+//'` if [ "$infos" != "" ]; then echo " √" search="bin/transmission-daemon" @@ -502,4 +506,4 @@ if [ $AUTOINSTALL = 1 ]; then else # 执行 showMainMenu -fi \ No newline at end of file +fi diff --git a/release/install-tr-control.sh b/release/install-tr-control.sh index 13b2e19..138efa7 100644 --- a/release/install-tr-control.sh +++ b/release/install-tr-control.sh @@ -406,7 +406,7 @@ getTransmissionPath() { if [ ! -d "$ROOT_FOLDER" ]; then showLog "$MSG_FIND_WEB_FOLDER_FROM_PROCESS" "n" - infos=`ps -ef | awk '/[t]ransmission-da/{print $8}'` + infos=`ps -Aww -o command= | sed -r -e '/[t]ransmission-da/!d' -e 's/ .+//'` if [ "$infos" != "" ]; then echo " √" search="bin/transmission-daemon" @@ -502,4 +502,4 @@ if [ $AUTOINSTALL = 1 ]; then else # 执行 showMainMenu -fi \ No newline at end of file +fi