diff --git a/createlinks b/createlinks index a6b6ff1..c6d2dac 100755 --- a/createlinks +++ b/createlinks @@ -20,6 +20,7 @@ safe_symlink("restart", "root/etc/e-smith/events/email-update/services2adjust/my event_link("sogo-delete-backup", "pre-backup", "60"); event_link("sogo-delete-backup", "post-backup", "60"); event_link("sogo-backup", "pre-backup", "70"); +event_link("sogo-delete-user", "user-delete", "10"); panel_link("sogo", "manager"); diff --git a/root/etc/e-smith/events/actions/sogo-delete-user b/root/etc/e-smith/events/actions/sogo-delete-user new file mode 100644 index 0000000..9733f85 --- /dev/null +++ b/root/etc/e-smith/events/actions/sogo-delete-user @@ -0,0 +1,16 @@ +#!/bin/bash + +EVENT=$1 +USER=$2 + +if [ -z "$EVENT" ]; then + echo "event name is missing" + exit 1 +fi +if [ -z "$USER" ]; then + echo "user account is missing" + exit 1 +fi + +su - sogo -c "/usr/sbin/sogo-tool remove $USER" > /dev/null 2>&1 +