Skip to content

Commit 81abe68

Browse files
这次可以手动输入密码了,并且显示的密码更加清晰了
1 parent bc4bc25 commit 81abe68

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

20181203230829.png

-9.02 KB
Loading

BDW.sh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
33
export PATH
44

5-
sh_ver="1.0.4"
5+
sh_ver="1.0.5"
66
file="/root/BaiduPCSWeb"
77
Folder="/usr/local/BaiduPCSWeb"
88
BaiduPCS_Go="/usr/bin/BaiduPCS-Go"
@@ -282,7 +282,7 @@ Set_BaiduPCS_password(){
282282
283283
${Green_font_prefix} 0.${Font_color_suffix} 显示密码
284284
————————
285-
${Green_font_prefix} 1.${Font_color_suffix} 修改密码为123456
285+
${Green_font_prefix} 1.${Font_color_suffix} 修改密码
286286
${Green_font_prefix} 2.${Font_color_suffix} 删除密码
287287
————————
288288
${Green_font_prefix} 3.${Font_color_suffix} 清空所有账号信息(包括密码与登陆的账号)
@@ -291,17 +291,20 @@ Set_BaiduPCS_password(){
291291
read -e -p "(默认: 取消):" set_num
292292
[[ -z "${set_num}" ]] && echo "已取消..." && exit 1
293293
if [[ ${set_num} == "0" ]]; then
294-
echo -e "$yellow access_pass 之后的才是密码(技术受限,我也不知道怎么单独提取出来!)$none"
294+
echo -e "$yellow 下面显示的密码请忽略引号!$none"
295295
echo -e ""
296+
BaiduPCS_password1=$(grep access_pass ${Folder}/pcs_config.json)
297+
# 从左至右从第15位开始显示
298+
echo ${BaiduPCS_password1:15}
296299
echo -e ""
297300
echo -e ""
298-
grep "access_pass" ${Folder}/pcs_config.json
299301
elif [[ ${set_num} == "1" ]]; then
300-
# echo -e "$yellow请输入您要设置的密码"
301-
# read -e -p "" BaiduPCS_passwrord_opt
302-
echo -e "$yellow 正在将密码设置为 123456$none"
303-
echo -e "$yellow 有能力的大佬可以指点我如何能设置成手动输入的密码!$none"
304-
sed -i '/access_pass/c\ "access_pass": "123456",' ${Folder}/pcs_config.json
302+
echo -e "$yellow请输入您要设置的密码"
303+
read -e BaiduPCS_passwrord_opt
304+
echo -e "$yellow 正在将密码设置为 ${BaiduPCS_passwrord_opt} $none"
305+
# 替换成不常用的变量,然后再替换变量以绕过引号带来的负面伤害!
306+
sed -i '/access_pass/c\ "access_pass": "shaoxia.xyz",' ${Folder}/pcs_config.json
307+
sed -i "s/shaoxia.xyz/"${BaiduPCS_passwrord_opt}"/g" ${Folder}/pcs_config.json
305308
ReStart_BaiduPCS_Web
306309
echo -e "$yellow 如果出现错误可以使用删除密码或者清空账号信息解决$none"
307310
elif [[ ${set_num} == "2" ]]; then

0 commit comments

Comments
 (0)