1 Star 0 Fork 2

KeyGen/PyScada

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
install.sh 1.58 KB
一键复制 编辑 原始数据 按行查看 历史
clavay 提交于 2023-06-22 10:54 . pyscada installation in venv
#!/bin/bash
# check if the script is run from script directory
SOURCE=${BASH_SOURCE[0]}
while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
SOURCE=$(readlink "$SOURCE")
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
if [[ "$DIR" != "$PWD" ]]; then
echo "You must run this script from $DIR"
exit 1
fi
# Make sure only root can run our script
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Choose the config method (venv or docker)
answer_config=""
echo "choose your installation"
while [[ "$answer_config" == "" ]]; do
read -p "1: venv, 2: docker : " answer_config
case $answer_config in
"1")
#remove logs file if exist (to avoid appending)
if [ -f logs_install.txt ]; then
rm logs_install.txt
fi
#execute the install_venv.sh script and output error in logs file
source install_venv.sh 2>&1 | tee -a logs_install.txt 1>&2 | { while IFS= read -r line; do echo "$line"; done; }
;;
"2")
#remove logs file if exist (to avoid appending)
if [ -f logs_docker.txt ]; then
rm logs_docker.txt
fi
source install_docker.sh 2>&1 | tee -a logs_docker.txt 1>&2 | { while IFS= read -r line; do echo "$line"; done; }
;;
*)
echo "choose a valid configuration"
answer_config=""
;;
esac
#statements
done
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/songxp03/PyScada.git
git@gitee.com:songxp03/PyScada.git
songxp03
PyScada
PyScada
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385