Files
cti/installer/debian/postinst
2026-10-14 23:05:02 +03:30

30 lines
1.1 KiB
Bash

#!/bin/sh
set -e
if [ "$1" = configure ]; then
mkdir -p /etc/nginx/sites-enabled
mkdir -p /etc/nginx/raymand-cti /opt/cti/nginx-management
if [ -f /opt/cti/nginx-management/host.json ]; then
chmod 0644 /opt/cti/nginx-management/host.json
fi
if [ ! -e /etc/nginx/raymand-cti/webrtc.conf ]; then
install -o root -g root -m 0644 /dev/null /etc/nginx/raymand-cti/webrtc.conf
fi
/usr/sbin/visudo -cf /etc/sudoers.d/raymand-cti-nginx >/dev/null
/usr/sbin/visudo -cf /etc/sudoers.d/raymand-cti-serial >/dev/null
/usr/lib/raymand-cti/ensure-nginx-proxy-include
mkdir -p /var/www/cti /opt/cti/log
/usr/lib/raymand-cti/setup-https
ln -sfn /etc/nginx/sites-available/raymand-cti /etc/nginx/sites-enabled/raymand-cti
if [ -L /etc/nginx/sites-enabled/default ]; then
rm -f /etc/nginx/sites-enabled/default
fi
systemctl disable --now pline.service >/dev/null 2>&1 || true
systemctl disable --now raymandcti.service >/dev/null 2>&1 || true
systemctl daemon-reload
systemctl enable raymnad-cti.service nginx.service
fi
exit 0