Skip to content

Commit

Permalink
Change ldapmodify usage since ubuntu22 - suite (#524)
Browse files Browse the repository at this point in the history
  • Loading branch information
lecorguille authored Oct 7, 2024
1 parent 302e74c commit 1cf920e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
9 changes: 9 additions & 0 deletions templates/abims/user/delete_group.sh
Original file line number Diff line number Diff line change
@@ -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 ..."
13 changes: 13 additions & 0 deletions templates/abims/user/expire_user.sh
Original file line number Diff line number Diff line change
@@ -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 ..."
13 changes: 13 additions & 0 deletions templates/abims/user/renew_user.sh
Original file line number Diff line number Diff line change
@@ -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 ..."

0 comments on commit 1cf920e

Please sign in to comment.