自动化部署脚本--linux执行sh脚本

匿名 (未验证) 提交于 2019-12-02 21:59:42

自动化部署脚本文件目录:

运行主程序:./install.sh

#!/bin/bash

SCRIPTPATH=$(cd "$(dirname "$0")"; pwd)

Install_log=$SCRIPTPATH/install_log.txt

echo "***start install***" > $Install_log
echo " workspace is $SCRIPTPATH" | tee -a "$Install_log"


show_license() {
















}

install_expect(){


















}

install_unzip(){









}

install_killall(){









}

install_snmp(){











}

install_java(){













}

install_activemq(){






}

install_redis(){






}

install_systemdlib(){












}

install_postgres(){

































}



stop_firewalld(){








}

auto_run_config(){










autostart.sh


















}

#unzip simo and config simo
unzip_simo(){























}

run_simo(){


}


















exit 0

init-data.sh脚本如下:

#!/usr/bin/expect

set timeout 900
set user postgres
spawn su $user
expect "bash-4.2*"
send "psql\r"
expect "postgres=#"
send "alter user postgres with password ‘postgres‘;\r"
expect "postgres=#"
send "create user uxsino with password ‘Uxs!nO10‘;\r"
expect "postgres=#"
send "create database simo_dev owner uxsino;\r"
expect "postgres=#"
send "GRANT ALL PRIVILEGES ON DATABASE simo_dev to uxsino;\r"
expect "postgres=#"
send "\\q\r"
expect "bash-4.2*"
send "exit\r"
expect eof

原文:https://www.cnblogs.com/zyy98877/p/9254451.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!