I added some shell scripts changing some contents of file in /etc/init.d directory.
#!/bin/bash
set -x
DBMS_ID='testuser'
DBMS_PW1='*****'
CONFIG_EXEC="./some_program"
${CONFIG_EXEC} config <<EOF
yes
127.0.0.1
${DBMS_ID}
${DBMS_PW1}
yes
EOF
cp -f A.txt B.txt
so I expected result below
DB configuration...
HOST : 127.0.0.1
USER : testuser
PASS : ********
PORT : 3306
DB : mysql
UNIX_SOCKET : /tmp/mysql.sock
TESTING CONFIGURATION ...
[ERROR] - Mysql connect error[1045] : Access denied for user 'testuser'@'127.0.0.1' (using password: YES)
Do you want to setup database. [yes/no] : HOST : USER : PASS :
PORT (Default: 3306) : DB (Default: mysql) : UNIX_SOCKET (Default: /var/lib/mysql/mysql.sock) :
TESTING CONFIGURATION ...
[OK]
Done.
+ cp -f A.txt B.txt
but I got some error when reboot
DB configuration...
HOST : 127.0.0.1
USER : testuser
PASS : ********
PORT : 3306
DB : mysql
UNIX_SOCKET : /var/lib/mysql/mysql.sock
TESTING CONFIGURATION ...
[OK]
Do you want to setup database. [yes/no] : HOST : USER : + cp -f A.txt B.txt
some content in EOF block skipped. why this problem happened? and How can i fix it?