+#!/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