Skip to content

Instantly share code, notes, and snippets.

@cgt
Created August 1, 2018 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgt/8b6ff08da15868ec873962267103b0e5 to your computer and use it in GitHub Desktop.
Save cgt/8b6ff08da15868ec873962267103b0e5 to your computer and use it in GitHub Desktop.
rc.d/weechat
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: weechat
# REQUIRE: NETWORK
# KEYWORD: shutdown
. /etc/rc.subr
name="weechat"
rcvar=weechat_enable
start_cmd="${name}_start"
stop_cmd="${name}_stop"
load_rc_config $name
: ${weechat_enable:=no}
weechat_start() {
su - chat -c "tmux new-session -d -s irc weechat"
}
weechat_stop() {
su - chat -c "tmux kill-session -t irc"
}
run_rc_command "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment