-
Notifications
You must be signed in to change notification settings - Fork 199
/
entrypoint.sh
executable file
·41 lines (34 loc) · 922 Bytes
/
entrypoint.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
#!/usr/bin/env bash
set -e
set -x
#
# User Task
#
if [ "$(id -u)" -ne '0' ]; then
su user -c "wine reg QUERY 'HKEY_CURRENT_USER\Software\Tencent\WeChat'"
exec wine 'C:\Program Files\Tencent\WeChat\WeChat.exe'
fi
#
# Root Init
#
if [ -n "$AUDIO_GID" ]; then
groupmod -o -g "$AUDIO_GID" audio
fi
if [ -n "$VIDEO_GID" ]; then
groupmod -o -g "$VIDEO_GID" video
fi
if [ "$GID" != "$(id -g user)" ]; then
groupmod -o -g "$GID" group
fi
if [ "$UID" != "$(id -u user)" ]; then
usermod -o -u "$UID" user
fi
# FileSavePath
chown user:group /WechatFiles
# wine reg DELETE 'HKCU\Software\Tencent\WeChat' UpdateFailCnt /f &> /dev/null
# wine reg DELETE 'HKCU\Software\Tencent\WeChat' NeedUpdateType /f &> /dev/null
# rm "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/WeChat/All Users/config/configEx.ini"
#
# Switch to user:group, and re-run self to run user task
#
exec gosu user:group "$0" "$@"