From 9c3208eff7bfd4de03efe91803be61fd04b22b61 Mon Sep 17 00:00:00 2001 From: koichirok Date: Fri, 22 Aug 2014 08:29:34 +0000 Subject: [PATCH] 2014-08-22 Koichiro Kikuchi * FreeBSD/pandora_server: Fixed bug fail to start pandora_server with no profile. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10446 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 ++++ pandora_server/FreeBSD/pandora_server | 39 +++++++++++++-------------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index e28e7878f3..f7e47d5314 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2014-08-22 Koichiro Kikuchi + + * FreeBSD/pandora_server: Fixed bug fail to start pandora_server with + no profile. + 2014-08-21 Hirofumi Kosaka * lib/PandoraFMS/Core.pm: Prevent some warnings would be diff --git a/pandora_server/FreeBSD/pandora_server b/pandora_server/FreeBSD/pandora_server index 088a7f9aad..491a57d062 100755 --- a/pandora_server/FreeBSD/pandora_server +++ b/pandora_server/FreeBSD/pandora_server @@ -48,29 +48,28 @@ if [ "$2" ]; then eval pandora_server_enable="\${pandora_server_${profile}_enable:-$pandora_server_enable}" eval pandora_server_flags="\${pandora_server_${profile}_flags:-$pandora_server_flags}" eval pidfile="\${pandora_server_${profile}_pidfile:-$pidfile}" - pandora_server_flags="$pandora_server_flags -P $pidfile $pandora_server_configfile" else echo "$0: extra argument ignored" fi -else - if [ "${pandora_server_profiles}" ] && [ "$1" ]; then - for profile in ${pandora_server_profiles}; do - eval _enable="\${pandora_server_${profile}_enable}" - case "${_enable:-${pandora_server_enable}}" in - [Yy][Ee][Ss]);; - *) continue;; - esac - echo "===> pandora_server profile: ${profile}" - /usr/local/etc/rc.d/pandora_server $1 ${profile} - retcode="$?" - if [ "0${retcode}" -ne 0 ]; then - failed="${profile} (${retcode}) ${failed:-}" - else - success="${profile} ${success:-}" - fi - done - exit 0 - fi +elif [ "${pandora_server_profiles}" ] && [ "$1" ]; then + for profile in ${pandora_server_profiles}; do + eval _enable="\${pandora_server_${profile}_enable}" + case "${_enable:-${pandora_server_enable}}" in + [Yy][Ee][Ss]);; + *) continue;; + esac + echo "===> pandora_server profile: ${profile}" + /usr/local/etc/rc.d/pandora_server $1 ${profile} + retcode="$?" + if [ "0${retcode}" -ne 0 ]; then + failed="${profile} (${retcode}) ${failed:-}" + else + success="${profile} ${success:-}" + fi + done + exit 0 fi +pandora_server_flags="$pandora_server_flags -P $pidfile $pandora_server_configfile" + run_rc_command "$1"