1
+ <?PHP
2
+ /* This file and functionality is based on and uses the Dynamix Docker Danager from unRaid
3
+ * Script by mtongnz, Jan 2024
4
+ *
5
+ * Copyright 2005-2022, Lime Technology
6
+ * Copyright 2014-2022, Guilherme Jardim, Eric Schultz, Jon Panozzo.
7
+ * Copyright 2012-2022, Bergware International.
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU General Public License version 2,
11
+ * as published by the Free Software Foundation.
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ */
16
+ ?>
17
+ <?
18
+ $ docroot = $ docroot ?? $ _SERVER ['DOCUMENT_ROOT ' ] ?: '/usr/local/emhttp ' ;
19
+ require_once "$ docroot/plugins/dynamix.docker.manager/include/DockerClient.php " ;
20
+
21
+ $ images = array ();
22
+
23
+ // Take stdin from compose.sh and put into images array
24
+ $ f = fopen ( 'php://stdin ' , 'r ' );
25
+ while ( $ image = fgets ( $ f ) )
26
+ $ images [] = trim ($ image );
27
+ fclose ( $ f );
28
+ $ images = array_unique ($ images );
29
+
30
+
31
+ echo "\nUpdating unRaid's image version details for " . count ($ images ) . " image(s): \n" ;
32
+ $ DockerUpdate = new DockerUpdate ();
33
+
34
+ foreach ( $ images as $ image ) {
35
+ echo " - updating " . $ image . "\n" ;
36
+
37
+ // Delete current info to force an update
38
+ $ updateStatus = DockerUtil::loadJSON ($ dockerManPaths ['update-status ' ]);
39
+ $ updateStatus [$ image ]['local ' ] = null ;
40
+ DockerUtil::saveJSON ($ dockerManPaths ['update-status ' ], $ updateStatus );
41
+
42
+ // Update the version info
43
+ $ DockerUpdate ->reloadUpdateStatus ($ image );
44
+ }
45
+
46
+ echo "unRaid image versions updated \n" ;
47
+ ?>
0 commit comments