-
Notifications
You must be signed in to change notification settings - Fork 2
/
gow.plg
147 lines (131 loc) · 4.65 KB
/
gow.plg
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE PLUGIN [
<!ENTITY name "gow">
<!ENTITY author "zb140">
<!ENTITY org "games-on-whales">
<!ENTITY version "2022.06.14">
<!ENTITY launch "Settings/gow">
<!ENTITY gitURL "https://github.com/&org;/unraid-plugin/raw/main">
<!ENTITY gitPkgURL "https://github.com/&org;/unraid-plugin/raw/&version;">
<!ENTITY gitReleaseBaseURL "https://github.com/&org;/unraid-plugin/releases/download">
<!ENTITY gitModReleaseURL "&gitReleaseBaseURL;/modules-&version;">
<!ENTITY gitReleaseURL "&gitReleaseBaseURL;/&version;">
<!ENTITY gowGitUrl "https://github.com/&org;/gow/raw/master">
<!ENTITY pluginURL "&gitURL;/&name;.plg">
<!ENTITY plugin "/boot/config/plugins/&name;">
<!ENTITY emhttp "/usr/local/emhttp/plugins/&name;">
<!ENTITY script_dir "&plugin;/scripts">
]>
<PLUGIN
name="&name;"
author="&org;"
version="&version;"
launch="&launch;"
pluginURL="&pluginURL;"
min="6.9.2"
max="6.10.3"
support="https://discord.gg/kRGUDHNHt2"
>
<CHANGES>
### 2022.06.14
- Add support for unRAID 6.10.3
### 2022.06.09
- Add support for unRAID 6.10.1 and 6.10.2
### 2022.05.18
- Add support for unRAID 6.10.0
### 2021.12.29
- Add support for pre-release versions of unRAID
- Automatically download 32-bit drivers if an NVIDIA card is detected (used for Steam)
### 2021.06.27a
- Fix installing after reboot
### 2021.06.27
- Fix permissions for /dev/uinput
- Minor UI fixes
### 2021.06.26
- Initial version
</CHANGES>
<!--
Prepare to install the GoW plugin:
* create a temp dir to download scripts to
* Remove any pre-existing files corresponding to this version
-->
<FILE Run="/bin/bash">
<INLINE>
rm -f $(ls &plugin;/&name;*.txz 2>/dev/null|grep -v '&version;')
</INLINE>
</FILE>
<!-- create a bash script that includes all the entities as variables, for convenience -->
<FILE Name="&script_dir;/vars.sh">
<INLINE>
export GOW_NAME="&name;"
export GOW_AUTHOR="&author;":
export GOW_ORG="&org;"
export GOW_VERSION="&version;"
export GOW_LAUNCH="&launch;"
export GOW_GITURL="&gitURL;"
export GOW_GITPKGURL="&gitPkgURL;"
export GOW_GITMODRELEASEURL="&gitModReleaseURL;"
export GOW_GITRELEASEURL="&gitReleaseURL;"
export GOW_GITRELEASEBASEURL="&gitReleaseBaseURL;"
export GOW_GOWGITURL="&gowGitUrl;"
export GOW_PLUGINURL="&pluginURL;"
export GOW_PLUGIN="&plugin;"
export GOW_EMHTTP="&emhttp;"
export GOW_PACKAGES="kernel/uinput common/settings-ui nvidia/32-bit-drivers"
</INLINE>
</FILE>
<!-- Bash script to download and install the drivers and utilities -->
<FILE Name="&script_dir;/install.sh">
<URL>&gitPkgURL;/scripts/install.sh</URL>
<SHA256>0fdebb7e626327fb026c819d18057d8af44e26b80ae56e20f68bf93dfee5affb</SHA256>
<MD5>2e399109aa6086706502cdbea5648250</MD5>
</FILE>
<!-- Bash script to check preconditions before installing -->
<FILE Name="&script_dir;/preinstall.sh">
<URL>&gitPkgURL;/scripts/preinstall.sh</URL>
<SHA256>e7a129f30184a97ab52dfe6552a0758a7552ae3088f75c34f7eee8df1aee96b9</SHA256>
<MD5>6d35001f8dc6284b39dfee6c753875dd</MD5>
</FILE>
<!-- Bash script to uninstall -->
<FILE Name="&script_dir;/uninstall.sh">
<URL>&gitPkgURL;/scripts/uninstall.sh</URL>
<SHA256>693c3f9dfa8d71aae4053883566b5ecc061d40afa592e16dcdc6af637ad4cb47</SHA256>
<MD5>c59b2a488fbe5946b88415216c12e6d1</MD5>
</FILE>
<!-- Utilities used by the other scripts -->
<FILE Name="&script_dir;/utils.sh">
<URL>&gitPkgURL;/scripts/utils.sh</URL>
<SHA256>02eb913cb5e26e3de172a5b0e7ea05325d7c2b603b801cde899dd9a3d72910fe</SHA256>
<MD5>d385111e4d1ef7b1930942811178b29f</MD5>
</FILE>
<FILE Run="/bin/bash">
<INLINE>
cd &script_dir;
if ! bash ./preinstall.sh; then
echo "preconditions not met; not installing"
rm -rf &plugin;
exit 1
fi
if ! bash ./install.sh; then
echo "╔════════════════════════════╗"
echo "║ Installing Games on Whales ║"
echo "╚════════════════════════════╝"
echo "error while installing, cleaning up"
rm -rf &plugin;
exit 1
else
echo "success!"
fi
</INLINE>
</FILE>
<FILE Run="/bin/bash" Method="remove">
<INLINE>
echo "╔══════════════════════════════╗"
echo "║ Uninstalling Games on Whales ║"
echo "╚══════════════════════════════╝"
cd &script_dir;
bash &script_dir;/uninstall.sh || echo "couldn't run uninstaller"
rm -rf &plugin;
</INLINE>
</FILE>
</PLUGIN>