Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update run.sh #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ xhost + &>/dev/null
set -e
echo -e "[\033[32m\033[5m+\033[0m]Cloning speed may be slow, please waitting..."
DIR="deepin-wine-ubuntu"
[ -d $DIR ] && rm -rf $DIR
git clone https://github.com/wszqkzqk/${DIR}.git
[ -d "$DIR" ] && rm -rf "$DIR"
git clone --depth 1 "https://github.com/wszqkzqk/${DIR}.git"
##########build docker image
if sudo docker build -t docker-wine-linux ./; then
sed -i '4,14s/^/#&/g' $0
Expand All @@ -14,21 +14,21 @@ else
fi
#########create docker container
function CREATE() {
mkdir -p $(pwd)/APP_PATH
if sudo docker run -d -ti -v $(pwd)/APP_PATH:/root -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY -e GDK_SCALE -e GDK_DPI_SCALE \
--name docker-wine-$RANDOM docker-wine-linux /bin/bash|awk '{print substr($0,1,3)}'|tee docker.id &>/dev/null; then
dockerid=$(cat docker.id)
mkdir -p "$(pwd)/APP_PATH"
if sudo docker run -d -ti -v "$(pwd)/APP_PATH:/root" -v /tmp/.X11-unix:/tmp/.X11-unix -e "DISPLAY=unix$DISPLAY" -e GDK_SCALE -e GDK_DPI_SCALE \
--name "docker-wine-$RANDOM" docker-wine-linux /bin/bash|awk '{print substr($0,1,3)}'|tee docker.id &>/dev/null; then
dockerid="$(cat docker.id)"
return 0
else
printf "create container error,exit process\n"
return 127
fi
}
CREATE
code=$?
code="$?"
if [ "$code" == "0" ]; then
awk 'BEGIN{printf "Your container id is ";system("cat docker.id && echo");system("echo -n [\033[32m\033[5m+\033[0m]");\
printf "Run [source start.sh -i '" $dockerid "'";printf "TIM] to run TIM or another APP\n"}'
printf "Run [source start.sh -i '$dockerid'";printf "TIM] to run TIM or another APP\n"}'
echo
echo "Exec 'bash start.sh --help' for more information."
shred -f -u -v -z docker.id >/dev/null 2>&1
Expand Down