-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathonekey.sh
62 lines (57 loc) · 1.32 KB
/
onekey.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh
id(){
while [[ -z "$id" ]];do
echo -e "输入ID:\c"
read id
done
while [[ -z "$secret" ]];do
echo -e "输入Secret:\c"
read secret
done
while [[ -z "$refresh_token" ]];do
echo -e "输入refresh_token:\c"
read refresh_token
done
name
docker run -dit --name $name --restart always \
-e id=$id \
-e secret=$secret \
-e refresh_token=$refresh_token \
haoduck/e5renew
}
txt(){
while [[ -z "$txt_dir" ]];do
echo -e "输入包含id.txt,secret.txt,refresh_token.txt的目录:\c"
read txt_dir
done
name
docker run -dit --name $name --restart always \
-v $txt_dir:/work/config/ \
haoduck/e5renew
}
name(){
echo -e "输入Docker容器名(有多个账号的情况,用容器名区分,单账号直接回车):\c"
read $name
[[ -z "$name" ]] && name=e5renew
}
echo "说明:<https://haoduck.com/848.html> "
if [[ -z $(command -v docker) ]];then
bash <(curl -sL haoduck.com/sh/docker.sh)
fi
echo -e "
1.分别输入ID,Secret,refresh_token(默认)
2.输入包含id.txt,secret.txt,refresh_token.txt的目录(建议用绝对目录)
请输入:\c"
read num
case $num in
1)
id
;;
2)
txt
;;
*)
id
;;
esac
docker logs $name