update
This commit is contained in:
parent
84c25ce390
commit
f8905bae62
1 changed files with 15 additions and 1 deletions
|
@ -4,7 +4,7 @@
|
||||||
# VARIABLES #
|
# VARIABLES #
|
||||||
#-----------------------------------#
|
#-----------------------------------#
|
||||||
|
|
||||||
this_script_url="https://git.hhf.technology/hhf/script-management-cloudpanel/raw/branch/main/security/certificate-monitor.sh"
|
this_script_url="https://git.hhf.technology/hhf/script-management-cloudpanel/raw/branch/main/certificates/certificate-monitor.sh"
|
||||||
this_script_name="Certificate Monitoring and Installation Script"
|
this_script_name="Certificate Monitoring and Installation Script"
|
||||||
formatter_url="https://git.hhf.technology/hhf/TaskFormatter/raw/branch/main/bash_task_formatter/task_formatter.sh"
|
formatter_url="https://git.hhf.technology/hhf/TaskFormatter/raw/branch/main/bash_task_formatter/task_formatter.sh"
|
||||||
scriptname=$0
|
scriptname=$0
|
||||||
|
@ -144,7 +144,21 @@ EOF
|
||||||
|
|
||||||
# Function to setup incron
|
# Function to setup incron
|
||||||
setup_incron() {
|
setup_incron() {
|
||||||
|
# Add root to allowed users
|
||||||
|
if [ ! -f "/etc/incron.allow" ]; then
|
||||||
|
echo "Creating /etc/incron.allow..."
|
||||||
|
touch /etc/incron.allow
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if root is already in incron.allow
|
||||||
|
if ! grep -q "^root$" "/etc/incron.allow"; then
|
||||||
|
echo "root" >> /etc/incron.allow
|
||||||
|
echo "Added root to incron.allow"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set up the incrontab entry
|
||||||
echo "/etc/nginx/sites-enabled/ IN_CREATE /usr/local/bin/clp-install-certificate \$#" | sudo incrontab -
|
echo "/etc/nginx/sites-enabled/ IN_CREATE /usr/local/bin/clp-install-certificate \$#" | sudo incrontab -
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo -e "incron setup completed successfully $CHECK_MARK"
|
echo -e "incron setup completed successfully $CHECK_MARK"
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Reference in a new issue