Hello List, from Japan - 

OTRS includes some scripts already in the bin directory that help with
creating things from the command line. The otrs.addQueue script that comes
with OTRS is smart - thanks guys! If you tell it the queuename is
PARENT::CHILD, it goes and creates the queue called CHILD and puts it under
PARENT. Very cool. 

Here's a (too) simple shell script that makes a group, then queues starting
with the same name. Thanks go to Martin for his good backup.sh script, which
I used as the base to start this one. Actually, for my OTRS 2.0b2, I get
errors when I execute this, but the queues are created correctly. 

==========Start========
#!/bin/sh
# --
# queuemaker.sh - a queue and group making script for OTRS. 

echo "queuemaker.sh - <\$Revision: 0.1 $>"

# parse user input
while getopts "b:c:" Option
do
  case $Option in
    b)
      # otrs bin loc
      OTRS_BIN=$OPTARG
    ;;
    c)
      # company name
      COMP_NAME=$OPTARG
    ;;
  esac
done

shift $(($OPTIND - 1))

if [ "x${OTRS_BIN}" == "x" ] || [ "x${COMP_NAME}" == "x" ]; then
    echo ""
    echo "Usage: queuemaker.sh -b path/bin -c Short_Name_For_Company "
    echo ""
    echo "  Try: queuemaker.sh -b /opt/otrs/bin -c YOURCO"
    echo ""
    exit 1
fi

#  make group and queues
`${OTRS_BIN}/otrs.addGroup -n ${COMP_NAME}`
`${OTRS_BIN}/otrs.addQueue -g ${COMP_NAME} ${COMP_NAME}`
`${OTRS_BIN}/otrs.addQueue -g ${COMP_NAME} ${COMP_NAME}::Support`
`${OTRS_BIN}/otrs.addQueue -g ${COMP_NAME} ${COMP_NAME}::Projects`

exit 0
==========End============

If you know a better or more skillful way, please respond, since I know my
code has got to be pretty weak. 

Cheers,
Rick Cogley
Tokyo

-----Original Message-----
From: Cogley, Rick 
Sent: Thursday, June 16, 2005 2:07 PM
To: OTRS User List (otrs@otrs.org)
Subject: OTRS - automatic queue creation? 

Greetings from Japan - 

Just wondering how I can auto-create queues and system email addresses? 

Can I run the various OTRS perl programs from the command line, and if so,
which one would be used to create queues or system addresses? 

And, is there a "--help" switch that says what the perl script expects to be
fed as arguments? 

Kind Regards,
Rick
_______________________________________________
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
Support oder Consulting für Ihr OTRS System?
=> http://www.otrs.de/

Reply via email to