From: Nils Althaus Date: Tue, 20 Aug 2024 15:44:42 +0000 (+0200) Subject: Jira/Confluence Scripts for creation of LDAP groups X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=HEAD;p=pixelpark%2Fpp-admin-tools.git Jira/Confluence Scripts for creation of LDAP groups --- diff --git a/scripts/jira-confluence/extranet_space_groups_create.sh b/scripts/jira-confluence/extranet_space_groups_create.sh new file mode 100644 index 0000000..d4a7c6e --- /dev/null +++ b/scripts/jira-confluence/extranet_space_groups_create.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# extranet space groups create +# v0.5 +# ppa mickraus (code template) $ nilaltha + +#setting global vars +ENDPROG=false #for ending main_standalone() +RUN=0 #counting the loop + +#function start main standalone +function main_standalone() { +printf "\033c" +echo "`date`" +echo -ne "this script is for creating ldap groups for extranet spaces\n" +getspacekey +groupscreateldap +echo -ne "\n\n" +read -p "Type 'q' to Quit; To redo press 'Enter': " REDO +if [ $REDO = "q" ] ; then +ENDPROG=true +else +printf "\033c" +fi +} + + + +#function for getspacekey info from cli +function getspacekey() { +read -p "Space key: " SPACEKEY +} + +#function to create groups with $SPACEKEY +groupscreateldap() { + +#starting shell output +printf "\033c" +echo -ne "---\n" +echo "dn: cn=extranet-$SPACEKEY-users-commentator,ou=CRM-Groups,ou=Confluence,ou=Applications,o=Pixelpark,o=isp +cn: extranet-$SPACEKEY-users-commentator +objectClass: groupOfUniqueNames + +dn: cn=extranet-$SPACEKEY-users-consumer,ou=CRM-Groups,ou=Confluence,ou=Applications,o=Pixelpark,o=isp +cn: extranet-$SPACEKEY-users-consumer +objectClass: groupOfUniqueNames + +dn: cn=extranet-$SPACEKEY-users-editor_external,ou=CRM-Groups,ou=Confluence,ou=Applications,o=Pixelpark,o=isp +cn: extranet-$SPACEKEY-users-editor_external +objectClass: groupOfUniqueNames + +dn: cn=extranet-$SPACEKEY-users-editor_internal,ou=CRM-Groups,ou=Confluence,ou=Applications,o=Pixelpark,o=isp +cn: extranet-$SPACEKEY-users-editor_internal +objectClass: groupOfUniqueNames + +dn: cn=extranet-$SPACEKEY-users-extranet_user,ou=CRM-Groups,ou=Confluence,ou=Applications,o=Pixelpark,o=isp +cn: extranet-$SPACEKEY-users-extranet_user +objectClass: groupOfUniqueNames + +dn: cn=extranet-$SPACEKEY-users-extranet_user_manager,ou=CRM-Groups,ou=Confluence,ou=Applications,o=Pixelpark,o=isp +cn: extranet-$SPACEKEY-users-extranet_user_manager +objectClass: groupOfUniqueNames" | tee -a "create_${SPACEKEY}_ldap_groups.ldif" +} + +#starting main_standalone() +while [ "$ENDPROG" = false ] ; do +main_standalone +done \ No newline at end of file diff --git a/scripts/jira-confluence/ldap_group_create.sh b/scripts/jira-confluence/ldap_group_create.sh new file mode 100644 index 0000000..734dee2 --- /dev/null +++ b/scripts/jira-confluence/ldap_group_create.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# ldap group create for space permissions +# v0.5 +# ppa mickraus (code template) $ nilaltha + +#setting global vars +ENDPROG=false #for ending main_standalone() +RUN=0 #counting the loop + +#function start main standalone +function main_standalone() { +printf "\033c" +echo "`date`" +echo -ne "this script is for creating an ldap group to manage extranet and jira space permissions\n" +getgroupname +groupscreateldap +echo -ne "\n\n" +read -p "Type 'q' to Quit; To redo press 'Enter': " REDO +if [ $REDO = "q" ] ; then +ENDPROG=true +else +printf "\033c" +fi +} + + + +#function for getspacekey info from cli +function getgroupname() { +read -p "Group name: " GROUPNAME +} + +#function to create groups with $GROUPNAME +groupscreateldap() { + +#starting shell output +printf "\033c" +echo -ne "---\n" +echo "dn: cn=$GROUPNAME,ou=CRM-Groups,ou=Confluence,ou=Applications,o=Pixelpark,o=isp +cn: $GROUPNAME +objectClass: groupOfUniqueNames" | tee -a "create_${GROUPNAME}_ldap_group.ldif" +} + +#starting main_standalone() +while [ "$ENDPROG" = false ] ; do +main_standalone +done