GREEN   33   0
   371 2.9 KB    76

sillytavern rc script

By Guest
Created: 2024-03-07 09:46:30
Expiry: Never

  1. 1.
    #!/bin/sh
  2. 2.
     
  3. 3.
    # PROVIDE: sillytavern
  4. 4.
    # REQUIRE: NETWORKING DAEMON
  5. 5.
    # KEYWORD: shutdown
  6. 6.
    #
  7. 7.
    # Add the following lines to /etc/rc.conf.local or /etc/rc.conf
  8. 8.
    # to enable this service:
  9. 9.
    #
  10. 10.
    # sillytavern_enable (bool): Set it to YES to enable sillytavern.
  11. 11.
    # Default is "NO".
  12. 12.
    # sillytavern_dir (str): Set the path to use for the node directory.
  13. 13.
    # Default is "/usr/local/etc/sillytavern"
  14. 14.
    # sillytavern_port (number): Set the port to listen on.
  15. 15.
    # Default is "8000".
  16. 16.
    # sillytavern_args (str): Additional args to pass to sillytavern.
  17. 17.
    # Default is "".
  18. 18.
    # sillytavern_syslog_output_priority (str): Set syslog priority if syslog enabled.
  19. 19.
    # Default is "info". See daemon(8).
  20. 20.
    # sillytavern_syslog_output_facility (str): Set syslog facility if syslog enabled.
  21. 21.
    # Default is "daemon". See daemon(8).
  22. 22.
     
  23. 23.
    # What a mess...
  24. 24.
    # add and chown a sillytavern directory in the pid folder so the altered user can edit it, and pull down the git repo to a similarly chown'd folder in /usr/local/etc/sillytavern
  25. 25.
    # you'll need to run the installer .sh once, but from then on you shouldn't need to unless you update
  26. 26.
     
  27. 27.
    . /etc/rc.subr
  28. 28.
     
  29. 29.
    name="sillytavern"
  30. 30.
     
  31. 31.
    load_rc_config $name
  32. 32.
    : ${sillytavern_enable:="NO"}
  33. 33.
    : ${sillytavern_dir:="/usr/local/etc/sillytavern"}
  34. 34.
    : ${sillytavern_port:="8000"}
  35. 35.
    : ${sillytavern_args:=""}
  36. 36.
    : ${sillytavern_user:="sillytavern"}
  37. 37.
    : ${sillytavern_group:="sillytavern"}
  38. 38.
     
  39. 39.
    rcvar=sillytavern_enable
  40. 40.
    pidfile=/var/run/sillytavern/${name}.pid
  41. 41.
     
  42. 42.
    # If daemon syslog functionality supported, concatenate syslog flags for passing to daemon.
  43. 43.
    DAEMON=$(/usr/sbin/daemon 2>&1 | grep -q syslog ; echo $?)
  44. 44.
    if [ ${DAEMON} -eq 0 ]; then
  45. 45.
    : ${sillytavern_syslog_output_enable:="NO"}
  46. 46.
    : ${sillytavern_syslog_output_priority:="info"}
  47. 47.
    : ${sillytavern_syslog_output_facility:="daemon"}
  48. 48.
    if checkyesno sillytavern_syslog_output_enable; then
  49. 49.
    sillytavern_syslog_output_flags="-t ${name} -T ${name}"
  50. 50.
     
  51. 51.
    if [ -n "${sillytavern_syslog_output_priority}" ]; then
  52. 52.
    sillytavern_syslog_output_flags="${sillytavern_syslog_output_flags} -s ${sillytavern_syslog_output_priority}"
  53. 53.
    fi
  54. 54.
     
  55. 55.
    if [ -n "${sillytavern_syslog_output_facility}" ]; then
  56. 56.
    sillytavern_syslog_output_flags="${sillytavern_syslog_output_flags} -l ${sillytavern_syslog_output_facility}"
  57. 57.
    fi
  58. 58.
    fi
  59. 59.
    else
  60. 60.
    sillytavern_syslog_output_enable="NO"
  61. 61.
    sillytavern_syslog_output_flags=""
  62. 62.
    fi
  63. 63.
     
  64. 64.
    # Env Setup
  65. 65.
    export HOME=$( getent passwd "$sillytavern_runas" | cut -d: -f6 ) # Gets the home directory of the runAs user
  66. 66.
     
  67. 67.
    exec_path="/usr/local/bin/node"
  68. 68.
    procname=${exec_path}
  69. 69.
     
  70. 70.
    sillytavern_chdir=${sillytavern_dir}
  71. 71.
     
  72. 72.
    command_interpreter="daemon"
  73. 73.
    command="/usr/sbin/daemon"
  74. 74.
    command_args="-f -r -P ${pidfile} ${sillytavern_syslog_output_flags} ${exec_path} ${sillytavern_dir}/server.js ${sillytavern_args}"
  75. 75.
     
  76. 76.
    run_rc_command "$1"

Yandere Thread - Yandere Applejack (completed)

by Guest

Bonding with Nature

by Guest

The Long and Short of It (RGRE)

by Guest

incest relationships piece of the whole pie (lewd) by Frostybox[...]

by Guest

incest thread piece of the (non-canon) pie, limestone's pie by[...]

by Guest