diff --git a/templates/abims/user/delete_group.sh b/templates/abims/user/delete_group.sh new file mode 100755 index 00000000..9d6a0c9e --- /dev/null +++ b/templates/abims/user/delete_group.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +echo "Start delete_group.sh in $0 ..." + +set -e + +ldapdelete -h {{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/{{ group.name }}.{{ fid }}.ldif" + +echo "End delete_group.sh in $0 ..." diff --git a/templates/abims/user/expire_user.sh b/templates/abims/user/expire_user.sh new file mode 100755 index 00000000..8253139c --- /dev/null +++ b/templates/abims/user/expire_user.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +echo "Start expire_user.sh in $0 ..." + +set -e + +ldapmodify -h {{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/{{ user.uid }}.{{ fid }}.ldif" + +if [ -e "{{ user.home }}/.ssh/authorized_keys" ]; then + mv "{{ user.home }}/.ssh/authorized_keys" "{{ user.home }}/.ssh/authorized_keys.expired" +fi + +echo "End expire_user.sh in $0 ..." diff --git a/templates/abims/user/renew_user.sh b/templates/abims/user/renew_user.sh new file mode 100755 index 00000000..2b4aea57 --- /dev/null +++ b/templates/abims/user/renew_user.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +echo "Start renew_user.sh in $0 ..." + +set -e + +ldapmodify -H ldap://{{ CONFIG.ldap.host }} -cx -w '{{ CONFIG.ldap.admin_password }}' -D {{ CONFIG.ldap.admin_cn }},{{ CONFIG.ldap.admin_dn }} -f "{{ CONFIG.general.script_dir }}/{{ user.uid }}.{{ fid }}.ldif" + +if [ -e "{{ user.home }}/.ssh/authorized_keys.expired" ]; then + mv "{{ user.home }}/.ssh/authorized_keys.expired" "{{ user.home }}/.ssh/authorized_keys" +fi + +echo "End renew_user.sh in $0 ..."