From 4d99b771fe229ae6c361dbd06b7a20c8866b406a Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Mon, 27 Jul 2026 15:19:53 +0300 Subject: net-im/hommabot: add distinfo, refactor --- net-im/hommabot/files/hommabot.in | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'net-im/hommabot/files') diff --git a/net-im/hommabot/files/hommabot.in b/net-im/hommabot/files/hommabot.in index d0787d1..602433d 100644 --- a/net-im/hommabot/files/hommabot.in +++ b/net-im/hommabot/files/hommabot.in @@ -19,8 +19,8 @@ load_rc_config "${name}" pidfile="/var/run/${name}.pid" procname="/usr/sbin/daemon" -command="/usr/sbin/daemon" +start_precmd="${name}_prestart" start_cmd="${name}_start" hommabot_prestart() @@ -48,8 +48,6 @@ hommabot_start() { local bot_token - hommabot_prestart || return 1 - if check_pidfile "${pidfile}" "${procname}" >/dev/null; then echo "${name} is already running." return 1 @@ -57,6 +55,11 @@ hommabot_start() 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" return 1 @@ -64,8 +67,9 @@ hommabot_start() echo "Starting ${name}." - exec /usr/sbin/daemon \ + /usr/sbin/daemon \ -f \ + -H \ -P "${pidfile}" \ -o "${hommabot_log_file}" \ /usr/bin/env \ -- cgit v1.3