otrs/init
2023-04-24 15:33:28 +10:00

25 lines
729 B
Bash
Executable File

#!/bin/sh
OTRS_SOCK_DIR=/var/run/otrs
NGINX_USER=nginx
# Make our CGI socker
mkdir ${OTRS_SOCK_DIR}
chown ${NGINX_USER} ${OTRS_SOCK_DIR}
su ${NGINX_USER} -s /bin/sh -c "/usr/bin/fcgiwrap -fs unix:${OTRS_SOCK_DIR}/otrs.cgi.sock" &
ln -s /otrs/Config.pm /opt/otrs/Kernel/Config.pm
ln -s /otrs/Files/ZZZAAuto.pm /opt/otrs/Kernel/Files/
ln -s /otrs/Files/ZZZACL.pm /opt/otrs/Kernel/Files/
ln -s /otrs/Files/ZZZProcessManagement.pm /opt/otrs/Kernel/Files/
# Install OTRS Modules
su otrs -lc "bin/otrs.Console.pl Maint::Config::Rebuild; bin/otrs.Console.pl Admin::Package::ReinstallAll"
# Start cron and the OTRS Daemon
/usr/sbin/crond
/opt/otrs/bin/Cron.sh start otrs
# Finally start NGINX
exec /usr/sbin/nginx "-g daemon off;"