Shadow-Here


Server : Apache
System : Linux methusalix2 3.16.0-11-amd64 #1 SMP Debian 3.16.84-1 (2020-06-09) x86_64
User : hios ( 1437)
PHP Version : 5.6.40-0+deb8u12
Disable Function : proc_close,proc_open,dl,shell_exec,passthru
Directory :  /usr/local/bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :
Current File : //usr/local/bin/cosmo-letsencrypt-nowww
#!/bin/bash

if grep -q "VhostITKSSLLE.* $1 " /etc/apache2/sites-enabled/* ; then
  echo "Zertifikat schon gemacht fĂźr $1";
  exit 1
fi

dir=`grep "VhostITK .* $1 " /etc/apache2/sites-enabled/200-$1|awk -F " " '{print $6}'`
if [  -z "$dir" ] ; then
  echo "Domain $1 nicht gefunden"
  exit 1
fi
letsencrypt certonly --webroot -w  $dir  -d $1
rc=$?
if [[ $rc != 0 ]]; then 
  echo "Zertifikat konnte nicht erstellt werden fĂźr $1 Pfad $dir"
  exit $rc
fi

cp -p /etc/apache2/sites-available/$1 /etc/apache2/sites-available/$1.saved
grep "VhostITK .* $1 " /etc/apache2/sites-enabled/200-$1|sed 's/VhostITK/VhostITKSSLLE/g' >>/etc/apache2/sites-available/$1

if ( /usr/sbin/apache2ctl -t  ); then
   if ( ! /usr/sbin/service apache2 reload ); then
        echo "apache2 reload gescheitert! Bitte Support verständigen"
	exit 1
   fi
   echo "Zertifikat $1 erfolgreich eingerichtet!"
else
  cp -p /etc/apache2/sites-available/$1.saved /etc/apache2/sites-available/$1
  echo "Aktivierung des Zertifikats im Apache fehlgeschlagen! Bitte Support verständigen"
fi

Samx