SOT: Best strategy for automatize a flow that need user interaction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



I am working in a Dockerfile but there is a "secure" MariaDB server script
I need to run which is interactive and I don't know how to deal with this.

Basically this is the flow I have follow on the script at test environment
and is the same I want to achieve in the Dockerfile without user
interaction by just answering as you seen on the flow below:

    # /usr/bin/mysql_secure_installation

    Enter current password for root (enter for none): [ENTER] // because
there is no password
    OK, successfully used password, moving on...

    Set root password? [Y/n] n
     ... skipping.

    Remove anonymous users? [Y/n] Y
     ... Success!

    Disallow root login remotely? [Y/n] n
     ... skipping.

    Remove test database and access to it? [Y/n] Y
     - Dropping test database...
     ... Success!
     - Removing privileges on test database...
     ... Success!

    Reloading the privilege tables will ensure that all changes made so far
    will take effect immediately.

    Reload privilege tables now? [Y/n] Y
     ... Success!

    Cleaning up...

So I need to write a bash script or something else that could handle this
automatically but has not idea, how would you take care of this?
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux