mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-05-23 10:17:43 +03:00
29 lines
787 B
Bash
29 lines
787 B
Bash
#!/bin/ksh
|
|
|
|
daemon="/usr/local/bin/ssh-chat"
|
|
daemon_logger="daemon.info"
|
|
daemon_flags="--verbose --bind ':PORT' --identity PRIVATE_KEY --admin=ADMIN_FILE --motd=MOTD_FILE"
|
|
daemon_user="USER"
|
|
|
|
. /etc/rc.d/rc.subr
|
|
|
|
rc_bg=YES
|
|
rc_reload=NO
|
|
|
|
rc_cmd $1
|
|
|
|
# 1. Copy this file to `/etc/rc.d`
|
|
# $ cp ssh-chat/examples/openbsd_service /etc/rc.d/ssh_chat
|
|
#
|
|
# 2. Modify the values in daemon_flags and daemon_user based on your liking.
|
|
# You can also set the flags using rcctl:
|
|
# $ rcctl set ssh_chat flags --verbose --bind [...] --identity [...]
|
|
#
|
|
# 3. Create the user that will run this service (see `man useradd` or `man adduser`)
|
|
# $ useradd -m chat
|
|
#
|
|
# 4. Enable and start the service
|
|
# $ rcctl enable ssh_chat
|
|
# $ rcctl start ssh_chat
|
|
#
|
|
# 5. Check the logs in `/var/log/daemon` |