From 7fa08ef9b6310446cc640b139501b06b028cbc05 Mon Sep 17 00:00:00 2001 From: spion06 Date: Thu, 27 Dec 2012 19:59:25 -0600 Subject: [PATCH] Update init/freebsd to not use perl When using couchpotato on slimmed down versions of freebsd (freenas for example) sometimes perl is not available. Since the previous parsing of the INI required a "key = value" format it is pretty simple to use awk for this. --- init/freebsd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init/freebsd b/init/freebsd index eeba51d3..c9a6530e 100644 --- a/init/freebsd +++ b/init/freebsd @@ -36,9 +36,9 @@ load_rc_config ${name} WGET="/usr/local/bin/wget" # You need wget for this script to safely shutdown CouchPotato. if [ -e "${couchpotato_conf}" ]; then - HOST=`grep -A14 "\[core\]" "${couchpotato_conf}"|egrep "^host"|perl -wple 's/^host = (.*)$/$1/'` - PORT=`grep -A14 "\[core\]" "${couchpotato_conf}"|egrep "^port"|perl -wple 's/^port = (.*)$/$1/'` - CPAPI=`grep -A14 "\[core\]" "${couchpotato_conf}"|egrep "^api_key"|perl -wple 's/^api_key = (.*)$/$1/'` + HOST=`grep -A14 "\[core\]" "${couchpotato_conf}"|awk -F" = " '/^host/ {print $2}'` + PORT=`grep -A14 "\[core\]" "${couchpotato_conf}"|awk -F" = " '/^port/ {print $2}'` + CPAPI=`grep -A14 "\[core\]" "${couchpotato_conf}"|awk -F" = " '/^api_key/ {print $2}'` fi status_cmd="${name}_status"