Changeset View
Changeset View
Standalone View
Standalone View
games/automuteus/files/automuteus.in
Show All 13 Lines | |||||
name="automuteus" | name="automuteus" | ||||
rcvar="automuteus_enable" | rcvar="automuteus_enable" | ||||
load_rc_config $name | load_rc_config $name | ||||
: ${automuteus_enable:="NO"} | : ${automuteus_enable:="NO"} | ||||
: ${automuteus_conf:="%%PREFIX%%/etc/automuteus/config.txt"} | : ${automuteus_conf:="%%PREFIX%%/etc/automuteus/config.txt"} | ||||
: ${automuteus_log:="/var/log/automuteus.log"} | : ${automuteus_log:="/var/log/automuteus"} | ||||
0mp: Just a suggestion, I don't know if it makes it any easier to understand, but maybe… | |||||
command="%%PREFIX%%/bin/automuteus" | command="%%PREFIX%%/bin/automuteus" | ||||
pidfile=/var/run/${name}.pid | pidfile=/var/run/${name}.pid | ||||
start_cmd="automuteus_start" | start_cmd="automuteus_start" | ||||
Not Done Inline ActionsIt could be that if you set procname properly, then you won't need to reimplement stop_cmd. 0mp: It could be that if you set `procname` properly, then you won't need to reimplement `stop_cmd`. | |||||
automuteus_start() | automuteus_start() | ||||
{ | { | ||||
check_startmsgs && echo "Starting ${name}." | check_startmsgs && echo "Starting ${name}." | ||||
/usr/sbin/daemon \ | /usr/sbin/daemon \ | ||||
-p ${pidfile} \ | -p ${pidfile} \ | ||||
/usr/bin/env \ | /usr/bin/env \ | ||||
"CONFIG_FILE=${automuteus_conf}" \ | "CONFIG_PATH=${automuteus_conf}" \ | ||||
Not Done Inline ActionsI am not a great fan of how this script looks like at the moment. We can try to refactor it in another commit. 0mp: I am not a great fan of how this script looks like at the moment. We can try to refactor it in… | |||||
"LOG_PATH=${automuteus_log}" \ | "LOG_PATH=${automuteus_log}" \ | ||||
${command} | ${command} | ||||
} | } | ||||
run_rc_command "$1" | run_rc_command "$1" | ||||
Not Done Inline ActionsCould you be looking for pkill -F $pidfile? 0mp: Could you be looking for `pkill -F $pidfile`? |
Just a suggestion, I don't know if it makes it any easier to understand, but maybe automuteus_log could be replaced with something like automuteus_log_path or automuteus_log_dir to indicate that it is supposed to be a directory, not a standard file?