-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmp3tag
78 lines (64 loc) · 1.22 KB
/
mp3tag
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#! /bin/bash
mp3tag_src="${MP3TAG_SRC}"
mp3tag_installer_path="${MP3TAG_INSTALLER_PATH}"
mp3tag_app_path="/config/.wine/drive_c/Program Files/Mp3tag/Mp3tag.exe"
is_wine_installed() {
if command -v wine 2>&1 >/dev/null; then
echo 1
else
echo 0
fi
}
is_wine_configured() {
if [[ -f "/config/.wine/system.reg" ]]; then
echo 1
else
echo 0
fi
}
is_mp3tag_downloaded() {
if [[ -f "$mp3tag_installer_path" ]]; then
echo 1
else
echo 0
fi
}
is_mp3tag_installed() {
if [[ -f "$mp3tag_app_path" ]]; then
echo 1
else
echo 0
fi
}
# get_mp3tag_version() {
# # TODO
# }
configure_wine() {
wine winecfg
}
download_mp3tag() {
curl -SL -o "${mp3tag_installer_path}" "${mp3tag_src}"
}
install_mp3tag() {
wine "${mp3tag_installer_path}"
}
if [[ $(is_wine_installed) -eq 0 ]]; then
echo "Wine is not installed"
exit 1
fi
if [[ $(is_wine_configured) -eq 0 ]]; then
echo "Configuring Wine"
configure_wine
echo "exit code: $?"
fi
if [[ $(is_mp3tag_downloaded) -eq 0 ]]; then
echo "Downloading Mp3tag"
download_mp3tag
echo "exit code: $?"
fi
if [[ $(is_mp3tag_installed) -eq 0 ]]; then
echo "Installing Mp3tag"
install_mp3tag
echo "exit code: $?"
fi
wine "${mp3tag_app_path}"