forked from RokasUrbelis/docker-wine-linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
47 lines (46 loc) · 968 Bytes
/
start.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
#!/bin/bash
function RUN_APP() {
sudo docker exec -ti $1 /usr/bin/nohup /bin/bash &>/dev/null $2 &
}
function USAGE() {
echo 'Usage:'
echo ' -i [Docker Container ID or Name] [APP Name]'
echo ' <APP Name> list:'
echo ' QQ'
echo ' TIM'
echo ' WeChat'
echo ' BaiduNetDisk'
echo ' ThunderSpeed'
echo ' Foxmail'
echo 'Example: source start.sh -i 0af TIM'
}
APP_LIST=(
QQ
TIM
WeChat
BaiduNetDisk
ThunderSpeed
Foxmail
)
if [ $# != 3 ];then
USAGE
else
case ${1} in
-i)
shift ##ID
if { sudo docker ps -a |& grep $1; } &>/dev/null;then
ID=$1
shift ##APP
{ for i in ${APP_LIST[@]};do echo $i;done |& grep -i "^${1}$"; } 2>/dev/null 1>APP && RUN_APP ${ID} $(cat APP) \
|| echo "Sorry,'$1' not in list"
else
echo "ERROR: Docker Container ID \"$1\" doesn't exist."
return 2
fi
;;
*)
USAGE
;;
esac
fi
[ -f APP ] && shred -f -u -z APP >/dev/null 2>&1