How to configure WordPress Multisite by bash script?

There is not a lot of ways to my knowledge to ‘convert’ the website. The best solution I could suggest is by installing WordPress Multi-site freshly in a somewhere else then pull over the plugin files, theme files and uploads over to the newly installed multi-site. Then use any simple export/import plugins to pull over anything else needed like comments, posts, pages and other custom post types. This would be a much more time consuming solution but would work without risk to crashing things.

Note: Make sure on whatever solution you do pick to backup the database and files for the website in case a solution goes wrong you will have a copy to revert to on failure.