diff options
Diffstat (limited to 'net-im/hommabot')
| -rw-r--r-- | net-im/hommabot/Makefile | 2 | ||||
| -rw-r--r-- | net-im/hommabot/files/hommabot.in | 32 |
2 files changed, 18 insertions, 16 deletions
diff --git a/net-im/hommabot/Makefile b/net-im/hommabot/Makefile index 57ef247..3728705 100644 --- a/net-im/hommabot/Makefile +++ b/net-im/hommabot/Makefile @@ -1,6 +1,6 @@ PORTNAME= hommabot DISTVERSION= 2.1.0 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= net-im MAINTAINER= jan@jantuomi.fi diff --git a/net-im/hommabot/files/hommabot.in b/net-im/hommabot/files/hommabot.in index 602433d..653bf3f 100644 --- a/net-im/hommabot/files/hommabot.in +++ b/net-im/hommabot/files/hommabot.in @@ -7,7 +7,7 @@ . /etc/rc.subr name="hommabot" -rcvar="hommabot_enable" +rcvar="${name}_enable" load_rc_config "${name}" @@ -35,12 +35,21 @@ hommabot_prestart() return 1 fi - install -d -m 0700 "${hommabot_data_dir}" || return 1 + install -d -m 0700 "${hommabot_data_dir}" || { + echo "${name}: cannot create ${hommabot_data_dir}" + return 1 + } if [ ! -e "${hommabot_log_file}" ]; then - install -m 0600 /dev/null "${hommabot_log_file}" || return 1 + install -m 0600 /dev/null "${hommabot_log_file}" || { + echo "${name}: cannot create ${hommabot_log_file}" + return 1 + } else - chmod 0600 "${hommabot_log_file}" || return 1 + chmod 0600 "${hommabot_log_file}" || { + echo "${name}: cannot set permissions on ${hommabot_log_file}" + return 1 + } fi } @@ -48,17 +57,10 @@ hommabot_start() { local bot_token - if check_pidfile "${pidfile}" "${procname}" >/dev/null; then - echo "${name} is already running." + bot_token=$(cat "${hommabot_token_file}") || { + echo "${name}: cannot read ${hommabot_token_file}" return 1 - fi - - bot_token=$(cat "${hommabot_token_file}") || return 1 - - if [ -z "${bot_token}" ]; then - echo "${name}: token file ${hommabot_token_file} is empty" - return 1 - fi + } cd "%%PREFIX%%/libexec/hommabot" || { echo "${name}: cannot change to %%PREFIX%%/libexec/hommabot" @@ -67,7 +69,7 @@ hommabot_start() echo "Starting ${name}." - /usr/sbin/daemon \ + exec /usr/sbin/daemon \ -f \ -H \ -P "${pidfile}" \ |
