diff --git a/authentik_install.sh b/authentik_install.sh index aa36d71..270c32e 100644 --- a/authentik_install.sh +++ b/authentik_install.sh @@ -38,3 +38,12 @@ fi ${SUDO} docker-compose pull ${SUDO} docker-compose up + +# Create cronjob to sync deleted users from LDAP +${SUDO} mkdir /usr/local/src/authentik_ldap_sync +${SUDO} cp authentik_deleted_user_sync.sh /usr/local/src/authentik_ldap_sync +if [ ! -f "/var/spool/cron/crontabs/root" ]; then + ${SUDO} echo "0 0 */7 * * /usr/local/src/authentik_ldap_sync/authentik_deleted_user_sync.sh" > /var/spool/cron/crontabs/root +else + ${SUDO} echo "0 0 */7 * * /usr/local/src/authentik_ldap_sync/authentik_deleted_user_sync.sh" >> /var/spool/cron/crontabs/root +fi