Merge pull request #444 from papadave66/freebsd-ps

FreeBSD detection and FreeBSD ps(1) compatibility fix
This commit is contained in:
栽培者
2020-09-02 19:59:40 +08:00
committed by GitHub
2 changed files with 8 additions and 4 deletions

View File

@@ -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
fi

View File

@@ -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
fi