ERROR autoconfig-users.sh

  1. 9 years ago

    Dear FOP2 Team,

    I try instal fop2 from source (fop2-2.29.00-centos-x86_64.tgz) on elastix 2.5.

    I if run from CLI

    sh /usr/local/fop2/autoconfig-users.sh the error show like this below

    [root@localhost fop2]# sh autoconfig-users.sh
    autoconfig-users.sh: line 109: syntax error near unexpected token `<'
    autoconfig-users.sh: line 109: `done < <( mysql -NB -u $DBUSER $DBPASS -h $DBHOST $DBNAME -e "SHOW tables FROM \`$DBNAME\` LIKE 'fop2users'"; )'

    Can u help me solve this issue?

    Thanks

  2. admin

    4 May 2015 Administrator

    Do you have a < sign in your database password?

  3. No, I don't have, my password : password!!!

    Thanks

  4. admin

    5 May 2015 Administrator
    Edited 9 years ago by admin

    Well, you have an exclamation sign that most probably breaks the shell script also if its not escaped.

    I am not sure if it will work, but you can try to modify the script a little bit, find this line:

    DBPASSLINE=`cat /etc/amportal.conf | grep ^AMPDBPASS= | tail -n1`

    And change it to

    DBPASSLINE=`cat /etc/amportal.conf | grep ^AMPDBPASS= | tail -n1 | sed 's/!/\\!/g'`

    Or try changing your password to one without a special char like < > !

    If you modify autoconfig-users.sh and it works, then you will also have to modify autoconfig-buttons.sh

  5. Thanks. i will try and report the result.

  6. Hi Admin,

    The script is correct, no problem if i using sign !!! <> for password.

    I must run ./autoconfig-buttons.sh but if i run using command sh autoconfig-buttons.sh display error.

    Thanks

  7. admin

    6 May 2015 Administrator

    There is no need to prepend the shell, the script has execute permissions and calls explicitly bash on its first line. You can test the script by running

    /usr/local/fop2/autoconfig-users.sh

    And nothing else.

or Sign Up to reply!