Skip to content

Debian 11 inotify as alternative #1

Description

@syzygyinteractivemedia

Because "incron" is not available in Debian 11 anymore this could be an alternative:

apt install inotify-tools

create a file in: /usr/local/bin/clp-install-certificate-watcher

#!/bin/bash

inotifywait -m /etc/nginx/sites-enabled --format %f --exclude '.swp|.swx$' --event create |
    while read line1; do
       /usr/local/bin/clp-install-certificate ${line1}
       systemctl force-reload nginx
    done

create a new systemd service in: /etc/systemd/system/clp-install-certificate-watcher.service

[Unit]
Description="Run the custom Cloudpanel certificate watcher"

[Service]
ExecStart=/usr/local/bin/clp-install-certificate-watcher

[Install]
WantedBy=multi-user.target

and make sure it has the right permissions and reload the daemon and start service:

chmod 777 /usr/local/bin/clp-install-certificate-watcher
systemctl daemon-reload
systemctl enable clp-install-certificate-watcher
systemctl start clp-install-certificate-watcher

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions