]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Jira/Confluence Scripts for creation of LDAP groups master test
authorNils Althaus <nils.althaus@digitas.com>
Tue, 20 Aug 2024 15:44:42 +0000 (17:44 +0200)
committerNils Althaus <nils.althaus@digitas.com>
Tue, 20 Aug 2024 15:44:42 +0000 (17:44 +0200)
scripts/jira-confluence/extranet_space_groups_create.sh [new file with mode: 0644]
scripts/jira-confluence/ldap_group_create.sh [new file with mode: 0644]

diff --git a/scripts/jira-confluence/extranet_space_groups_create.sh b/scripts/jira-confluence/extranet_space_groups_create.sh
new file mode 100644 (file)
index 0000000..d4a7c6e
--- /dev/null
@@ -0,0 +1,67 @@
+#!/bin/bash\r
+# extranet space groups create\r
+# v0.5\r
+# ppa mickraus (code template) $ nilaltha\r
+\r
+#setting global vars\r
+ENDPROG=false   #for ending main_standalone()\r
+RUN=0           #counting the loop\r
+\r
+#function start main standalone\r
+function main_standalone() {\r
+printf "\033c"\r
+echo "`date`"\r
+echo -ne "this script is for creating ldap groups for extranet spaces\n"\r
+getspacekey\r
+groupscreateldap\r
+echo -ne "\n\n"\r
+read -p "Type 'q' to Quit; To redo press 'Enter': " REDO\r
+if [ $REDO = "q" ] ; then\r
+ENDPROG=true\r
+else\r
+printf "\033c"\r
+fi\r
+}\r
+\r
+\r
+\r
+#function for getspacekey info from cli\r
+function getspacekey() {\r
+read -p "Space key: " SPACEKEY\r
+}\r
+\r
+#function to create groups with $SPACEKEY\r
+groupscreateldap() {\r
+\r
+#starting shell output\r
+printf "\033c"\r
+echo -ne "---\n"\r
+echo "dn: cn=extranet-$SPACEKEY-users-commentator,ou=CRM-Groups,ou=Confluence,ou=Applications,o=Pixelpark,o=isp\r
+cn: extranet-$SPACEKEY-users-commentator\r
+objectClass: groupOfUniqueNames\r
+\r
+dn: cn=extranet-$SPACEKEY-users-consumer,ou=CRM-Groups,ou=Confluence,ou=Applications,o=Pixelpark,o=isp\r
+cn: extranet-$SPACEKEY-users-consumer\r
+objectClass: groupOfUniqueNames\r
+\r
+dn: cn=extranet-$SPACEKEY-users-editor_external,ou=CRM-Groups,ou=Confluence,ou=Applications,o=Pixelpark,o=isp\r
+cn: extranet-$SPACEKEY-users-editor_external\r
+objectClass: groupOfUniqueNames\r
+\r
+dn: cn=extranet-$SPACEKEY-users-editor_internal,ou=CRM-Groups,ou=Confluence,ou=Applications,o=Pixelpark,o=isp\r
+cn: extranet-$SPACEKEY-users-editor_internal\r
+objectClass: groupOfUniqueNames\r
+\r
+dn: cn=extranet-$SPACEKEY-users-extranet_user,ou=CRM-Groups,ou=Confluence,ou=Applications,o=Pixelpark,o=isp\r
+cn: extranet-$SPACEKEY-users-extranet_user\r
+objectClass: groupOfUniqueNames\r
+\r
+dn: cn=extranet-$SPACEKEY-users-extranet_user_manager,ou=CRM-Groups,ou=Confluence,ou=Applications,o=Pixelpark,o=isp\r
+cn: extranet-$SPACEKEY-users-extranet_user_manager\r
+objectClass: groupOfUniqueNames" | tee -a "create_${SPACEKEY}_ldap_groups.ldif"\r
+}\r
+\r
+#starting main_standalone()\r
+while [ "$ENDPROG" = false ] ; do\r
+main_standalone\r
+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 (file)
index 0000000..734dee2
--- /dev/null
@@ -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