diff --git a/mtproxy.sh b/mtproxy.sh index 656c61a..4b119d8 100644 --- a/mtproxy.sh +++ b/mtproxy.sh @@ -175,12 +175,20 @@ Set_port(){ done } Set_passwd(){ - echo "请输入 MTProxy 密匙(手动输入必须为32位,[0-9][a-z][A-Z],建议随机生成)" - stty erase '^H' && read -p "(默认:随机生成):" mtp_passwd - [[ -z "${mtp_passwd}" ]] && mtp_passwd=$(date +%s%N | md5sum | head -c 32) - echo && echo "========================" - echo -e " 密码 : ${Red_background_prefix} dd${mtp_passwd} ${Font_color_suffix}" - echo "========================" && echo + while true + do + echo "请输入 MTProxy 密匙(手动输入必须为32位,[0-9][a-z][A-Z],建议随机生成)" + stty erase '^H' && read -p "(避免出错,强烈推荐随机生成,直接回车):" mtp_passwd + if [[ -z "${mtp_passwd}" ]]; then + mtp_passwd=$(date +%s%N | md5sum | head -c 32) + else + [[ ${#mtp_passwd} != 32 ]] && echo -e "${Error} 请输入正确的密匙(32位字符)。" && continue + fi + echo && echo "========================" + echo -e " 密码 : ${Red_background_prefix} dd${mtp_passwd} ${Font_color_suffix}" + echo "========================" && echo + break + done } Set_tag(){ echo "请输入 MTProxy 的 TAG标签(TAG标签只有在通过官方机器人 @MTProxybot 分享代理账号后才会获得,不清楚请留空回车)" diff --git a/pac_get.sh b/pac_get.sh index 1aa09dc..7942feb 100644 --- a/pac_get.sh +++ b/pac_get.sh @@ -25,8 +25,8 @@ var ipv6_proxy = function(){ return nowall_proxy(); }; */ /* - * Copyright (C) 2017 Toyo - * https://softs.fun/Other/pac.txt + * Copyright (C) 2017-2018 Toyo + * https://softs.loan/Other/pac.txt */ var rules = [ @@ -869,4 +869,4 @@ PAC_BASE64=$(urlsafe_base64_d "${PAC_TEXT}"|grep -v "!"|sed '1d;s/\\/\\\\/g;/^\s PAC_NUM=$(echo "${PAC_BASE64}"|wc -l) echo "${PAC_TAME}${PAC_prefix}${PAC_BASE64}${PAC_suffix}" > "${Output_URL}" sed -i 's/$/\r/' "${Output_URL}" -echo "${PAC_NUM}" +echo "${PAC_NUM}" \ No newline at end of file