diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2026-07-27 15:19:53 +0300 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2026-07-27 15:19:53 +0300 |
| commit | 4d99b771fe229ae6c361dbd06b7a20c8866b406a (patch) | |
| tree | 8dc1504577d6109ecdb8f9cdb6f53c8c13a4c5f4 /net-im/hommabot/files | |
| parent | 8f7ff64c86236e437ba17dd55f3977a30bd45adb (diff) | |
net-im/hommabot: add distinfo, refactor
Diffstat (limited to 'net-im/hommabot/files')
| -rw-r--r-- | net-im/hommabot/files/hommabot.in | 12 |
1 files changed, 8 insertions, 4 deletions
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 \ |
