diff options
author | Michael Lando <ml636r@att.com> | 2017-02-19 10:28:42 +0200 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2017-02-19 10:51:01 +0200 |
commit | 451a3400b76511393c62a444f588a4ed15f4a549 (patch) | |
tree | e4f5873a863d1d3e55618eab48b83262f874719d /asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh | |
parent | 5abfe4e1fb5fae4bbd5fbc340519f52075aff3ff (diff) |
Initial OpenECOMP SDC commit
Change-Id: I0924d5a6ae9cdc161ae17c68d3689a30d10f407b
Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh')
-rw-r--r-- | asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh new file mode 100644 index 0000000000..400bcf40cb --- /dev/null +++ b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +echo "Debian based MYSQL install 5..." +LOCK="/tmp/lockaptget" + +while true; do + if mkdir "${LOCK}" &>/dev/null; then + echo "MySQL take the lock" + break; + fi + echo "Waiting the end of one of our recipes..." + sleep 0.5 +done + +while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do + echo "Waiting for other software managers to finish..." + sleep 0.5 +done +sudo rm -f /var/lib/dpkg/lock + +sudo apt-get update || (sleep 15; sudo apt-get update || exit ${1}) +sudo DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server-5.5 pwgen || exit ${1} +rm -rf "${LOCK}" + +sudo /etc/init.d/mysql stop +sudo rm -rf /var/lib/apt/lists/* +sudo rm -rf /var/lib/mysql/* +echo "MySQL Installation complete."
\ No newline at end of file |