makedeb


sillytavern 1.11.8-0


Multy-API LLM frontend

Viewing /sillytavern-wrapper.sh.

View raw.

Click here to go back to the Git tree for sillytavern.

#!/bin/sh

_name="sillytavern"
_SHAREPREFIX="/usr/share/${_name}"
_config_dir="${XDG_CONFIG_HOME:-$HOME/.config}/$_name"

fusecleanup()
{
  echo "Cleaning up fusemount"
  fusermount -qzu "$_config_dir/opt"
}

trap fusecleanup 1 2 3 6 15

mkdir -p "$_config_dir/opt" "$_config_dir/optdiff"
fusecleanup
echo "Fuse mounting of $_config_dir/opt"
unionfs -o cow -o umask=000 $_config_dir/optdiff=RW:${_SHAREPREFIX}=RO $_config_dir/opt || exit 1

printf "\33[2K\r\033[1;33m%s\033[0m\n\33[2K\r\033[1;33m%s\033[0m\n" "If  automatic unmounting fails, run this command:" "fusermount -zu $_config_dir/opt" >&2

echo "Entering SillyTavern..."
cd "$_config_dir/opt"
echo "Starting SillyTavern..."

node ./server.js || fusecleanup