From 0000c1dbe96b8709e266a8ab4435e6f08cedc829 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Tue, 11 Aug 2020 00:05:17 +0800 Subject: [PATCH] =?UTF-8?q?=E2=98=80=EF=B8=8F=20=E5=B0=9D=E8=AF=95?= =?UTF-8?q?=E6=94=AF=E6=8C=81=20Docker=20=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/docker-run.sh | 58 +++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/utils/docker-run.sh b/utils/docker-run.sh index ee7154c..01e785e 100644 --- a/utils/docker-run.sh +++ b/utils/docker-run.sh @@ -13,42 +13,58 @@ configure() { config_file=config.yml echo "生成配置文件中 . . ." cp config.gen.yml config.yml + echo "api_key、api_hash 申请地址: https://my.telegram.org/" printf "请输入应用程序 api_key:" read -r api_key <&1 - sed -i "s/KEY_HERE/$api_key/" $config_file + sed -i "s/ID_HERE/$api_key/" $config_file printf "请输入应用程序 api_hash:" read -r api_hash <&1 sed -i "s/HASH_HERE/$api_hash/" $config_file - printf "请输入应用程序语言(示例:zh-cn):" + printf "请输入应用程序语言(默认:zh-cn):" read -r application_language <&1 - sed -i "s/zh-cn/$application_language/" $config_file - printf "请输入应用程序地区(例如:China):" + if [ -z "$application_language" ] + then + echo "语言设置为 简体中文" + else + sed -i "s/zh-cn/$application_language/" $config_file + fi + printf "请输入应用程序地区(默认:China):" read -r application_region <&1 - sed -i "s/China/$application_region/" $config_file - printf "请输入 Google TTS 后缀(例如:cn):" + if [ -z "$application_region" ] + then + echo "地区设置为 中国" + else + sed -i "s/China/$application_region/" $config_file + fi + printf "请输入 Google TTS 语言(默认:zh-CN):" read -r application_tts <&1 - sed -i "s/cn/$application_tts/" $config_file + if [ -z "$application_tts" ] + then + echo "tts发音语言设置为 简体中文" + else + sed -i "s/zh-CN/$application_tts/" $config_file + fi printf "启用日志记录? [Y/n]" read -r logging_confirmation <&1 case $logging_confirmation in [yY][eE][sS]|[yY]) - printf "请输入您的日志记录群组/频道的 ChatID (如果要发送给 Kat ,请按Enter):" - read -r log_chatid <&1 - if [ -z "$log_chatid" ] - then - echo "LOG 将发送到 Kat." - else - sed -i "s/503691334/$log_chatid/" $config_file - fi - sed -i "s/log: False/log: True/" $config_file - ;; + printf "请输入您的日志记录群组/频道的 ChatID (如果要发送给 原 PagerMaid 作者 ,请按Enter):" + read -r log_chatid <&1 + if [ -z "$log_chatid" ] + then + echo "LOG 将发送到 原 PagerMaid 作者." + else + sed -i "s/503691334/$log_chatid/" $config_file + fi + sed -i "s/log: False/log: True/" $config_file + ;; [nN][oO]|[nN]) - echo "安装过程继续 . . ." + echo "安装过程继续 . . ." ;; *) - echo "输入错误 . . ." - exit 1 - ;; + echo "输入错误 . . ." + exit 1 + ;; esac }