-
Notifications
You must be signed in to change notification settings - Fork 0
/
nvidiatoggle.plg
92 lines (79 loc) · 1.99 KB
/
nvidiatoggle.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
<?xml version='1.0' standalone='yes'?>
<!DOCTYPE PLUGIN [
<!ENTITY name "nvidiatoggle">
<!ENTITY author "Fma965">
<!ENTITY version "2022.06.06">
<!ENTITY launch "Dashboard">
<!ENTITY gitURL "https://raw.githubusercontent.com/Cyanlabs/&name;-unraid/master">
<!ENTITY pluginURL "&gitURL;/&name;.plg">
<!ENTITY pkgURL "&gitURL;/pkg">
<!ENTITY plgPATH "/boot/config/plugins/&name;">
<!ENTITY plgNAME "&name;-&version;">
<!ENTITY emhttp "/usr/local/emhttp/plugins/&name;">
]>
<PLUGIN name="&name;"
author="&author;"
launch="&launch;"
version="&version;"
pluginURL="&pluginURL;"
icon="fa-toggle-off"
min="6.10.0">
<CHANGES>
##NVidiaToggle
###&version;
First Release
</CHANGES>
<!--
The 'pre-install' script.
-->
<FILE Run="/bin/bash">
<INLINE>
# Check to see if new install.
if [ ! -d "/boot/config/plugins/&name;" ]
then
mkdir "/boot/config/plugins/&name;"
fi
</INLINE>
</FILE>
<!--
Get the plugin bundle.
-->
<FILE Name="&plgPATH;/&plgNAME;.txz" Min="6.10" Run="upgradepkg --install-new">
<URL>&pkgURL;/&plgNAME;.txz</URL>
</FILE>
<!--
The 'post-install' script.
-->
<FILE Run="/bin/bash">
<INLINE>
# Adjust plugin permissions.
chmod 755 -R /usr/local/emhttp/plugins/&name; 2>/dev/null
# Fix permissions of executable files
chmod +x /usr/local/emhttp/plugins/&name;/scripts/* /usr/local/emhttp/plugins/&name;/event/*
# Update QEMU Hooks file and udev rules.
/usr/local/emhttp/plugins/&name;/scripts/install.sh 2>/dev/null
echo
echo "-----------------------------------------------------------"
echo " &name; has been installed."
echo " "
echo " Copyright 2022, &author;"
echo " Version: &version;"
echo ""
echo "-----------------------------------------------------------"
echo
</INLINE>
</FILE>
<!--
The 'remove' script.
-->
<FILE Run="/bin/bash" Method="remove">
<INLINE>
echo "Removing &name;..."
removepkg &plgPATH;/*.txz
rm -f /etc/libvirt/hooks/qemu.d/NvidiaToggle
rm -rf &plgPATH;
rm -rf &emhttp;
echo "&name; has been removed"
</INLINE>
</FILE>
</PLUGIN>