#!/bin/sh set -e runPosInst() { ## if [ ! -e /etc/ssl/private/pure-ftpd.pem ]; then mkdir -p /etc/ssl/private echo "US Unknown Unknown Unknown Unknown `hostname` ssl@cpanel.net" | \ openssl req -new -x509 -newkey rsa:1024 -days 9999 -nodes -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem fi for f in /usr/local/sbin/pureauth /usr/sbin/pureauth; do ( [ -e $f ] && rm -f $f && echo "File '$f' has been removed." ) || : done chmod 600 /etc/ssl/private/*.pem ( [ -x /usr/bin/systemctl ] && /usr/bin/systemctl daemon-reload ) ||: # should only happen on very first install, but we want to preserve the c5/6 behavior /usr/local/cpanel/scripts/cpservice pure-ftpd enable ||: /usr/local/cpanel/scripts/cpservice pure-authd enable ||: /usr/local/cpanel/bin/build_ftp_conf # let cPanel restart the service /usr/local/cpanel/scripts/restartsrv_pureftpd --no-verbose # Enable FTP icons in cPanel /bin/mkdir -p /var/cpanel/dynamicui || : chmod 755 /var/cpanel/dynamicui || : chown root: /var/cpanel/dynamicui || : /bin/touch /var/cpanel/dynamicui/ftp || : chmod 644 /var/cpanel/dynamicui/ftp || : ## } case "$1" in configure) runPosInst; ;; esac exit 0