<commit_before>#!/bin/sh
### BEGIN INIT INFO
# Provides:  CREATE LE SSL FOR ISPC AND OTHER MAIN SERVICES
# Required-Start:  $local_fs $network
# Required-Stop:  $local_fs
# Default-Start:  2 3 4 5
# Default-Stop:  0 1 6
# Short-Description:  CREATE LE SSL FOR ISPC AND OTHER MAIN SERVICES
# Description:  Create LE SSL for ISPC and other main services.
### END INIT INFO
# Enable set -e to cause script to exit on error
# set -e
# Backup exisiting ISPConfig ssl file(s)
cd /usr/local/ispconfig/interface/ssl/
mv ispserver.crt ispserver.crt-$(date +"%y%m%d%H%M%S").bak
mv ispserver.key ispserver.key-$(date +"%y%m%d%H%M%S").bak
# If ispserver.pem exists then back it up too
if [ -f "ispserver.pem" ]
then
	mv ispserver.pem ispserver.pem-$(date +"%y%m%d%H%M%S").bak
fi
# Create symlink to LE fullchain and key for ISPConfig
ln -s /etc/letsencrypt/live/$(hostname -f)/fullchain.pem ispserver.crt
ln -s /etc/letsencrypt/live/$(hostname -f)/privkey.pem ispserver.key
# Build ispserver.pem file and chmod it
cat ispserver.{key,crt} > ispserver.pem
chmod 600 ispserver.pem
service nginx restart
# Backup existing postfic ssl file(s)
cd /etc/postfix/
mv smtpd.cert smtpd.cert-$(date +"%y%m%d%H%M%S").bak
mv smtpd.key smtpd.key-$(date +"%y%m%d%H%M%S").bak
# Create symlink from ISPConfig then restart postfix and dovecot
ln -s /usr/local/ispconfig/interface/ssl/ispserver.crt smtpd.cert
ln -s /usr/local/ispconfig/interface/ssl/ispserver.key smtpd.key
service postfix restart
service dovecot restart
# Backup existing pure-ftpd ssl file(s)
cd /etc/ssl/private/
mv pure-ftpd.pem pure-ftpd.pem-$(date +"%y%m%d%H%M%S").bak
# Create symlink from ISPConfig, chmod it, then restart it
ln -s /usr/local/ispconfig/interface/ssl/ispserver.pem pure-ftpd.pem
chmod 600 pure-ftpd.pem
service pure-ftpd-mysql restart
# Create auto updater script for LE ispserver.pem
cd /etc/init.d/
wget 
chmod +x le_ispc_pem.sh
# Install incron, allow root user
apt-get install -yqq incron
cat "root" > /etc/incron.allow
# Create icrontab table for root
cd /var/spool/incron/
wget 
chmod 600 root
# Restart your webserver again
service nginx restart
# End of script<commit_msg>Update le4ispc.sh<commit_after>#!/bin/sh
### BEGIN INIT INFO
# Provides:  CREATE LE SSL FOR ISPC AND OTHER MAIN SERVICES
# Required-Start:  $local_fs $network
# Required-Stop:  $local_fs
# Default-Start:  2 3 4 5
# Default-Stop:  0 1 6
# Short-Description:  CREATE LE SSL FOR ISPC AND OTHER MAIN SERVICES
# Description:  Create LE SSL for ISPC and other main services.
### END INIT INFO
# Enable set -e to cause script to exit on error
# set -e
# Backup exisiting ISPConfig ssl file(s)
cd /usr/local/ispconfig/interface/ssl/
mv ispserver.crt ispserver.crt-$(date +"%y%m%d%H%M%S").bak
mv ispserver.key ispserver.key-$(date +"%y%m%d%H%M%S").bak
# If ispserver.pem exists then back it up too
if [ -f "ispserver.pem" ]
then
	mv ispserver.pem ispserver.pem-$(date +"%y%m%d%H%M%S").bak
fi
# Create symlink to LE fullchain and key for ISPConfig
ln -s /etc/letsencrypt/live/$(hostname -f)/fullchain.pem ispserver.crt
ln -s /etc/letsencrypt/live/$(hostname -f)/privkey.pem ispserver.key
# Build ispserver.pem file and chmod it
cat ispserver.{key,crt} > ispserver.pem
chmod 600 ispserver.pem
service nginx restart
# Backup existing postfic ssl file(s)
cd /etc/postfix/
mv smtpd.cert smtpd.cert-$(date +"%y%m%d%H%M%S").bak
mv smtpd.key smtpd.key-$(date +"%y%m%d%H%M%S").bak
# Create symlink from ISPConfig then restart postfix and dovecot
ln -s /usr/local/ispconfig/interface/ssl/ispserver.crt smtpd.cert
ln -s /usr/local/ispconfig/interface/ssl/ispserver.key smtpd.key
service postfix restart
service dovecot restart
# Backup existing pure-ftpd ssl file(s)
cd /etc/ssl/private/
mv pure-ftpd.pem pure-ftpd.pem-$(date +"%y%m%d%H%M%S").bak
# Create symlink from ISPConfig, chmod it, then restart it
ln -s /usr/local/ispconfig/interface/ssl/ispserver.pem pure-ftpd.pem
chmod 600 pure-ftpd.pem
service pure-ftpd-mysql restart
# Create auto updater script for LE ispserver.pem
cd /etc/init.d/
wget https://raw.githubusercontent.com/ahrasis/LE4ISPC/master/nginx/le_ispc_pem.sh
chmod +x le_ispc_pem.sh
# Install incron, allow root user
apt-get install -yqq incron
cat "root" > /etc/incron.allow
# Create icrontab table for root
cd /var/spool/incron/
wget https://raw.githubusercontent.com/ahrasis/LE4ISPC/master/root
chmod 600 root
# Restart your webserver again
service nginx restart
# End of script
{'fraction_non_alphanumeric': 0.12415196743554953, 'fraction_numerical': 0.007914970601537766, 'mean_word_length': 4.361212121212121, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '300334', 'n_tokens_mistral': 1766, 'n_tokens_neox': 1735, 'n_words': 488}