#!/usr/bin/php verbose = true; break; case 'check': $check = true; break; case 'nonotify': $nonotify = true; break;} } if (!isset($check)) { echo " Updating templates... "; $DockerTemplates->downloadTemplates(); echo " Updating info... "; $DockerTemplates->getAllInfo(true); echo " Done."; } else { require_once "$docroot/webGui/include/Wrappers.php"; $notify = "$docroot/webGui/scripts/notify"; $unraid = parse_plugin_cfg("dynamix",true); $var = parse_ini_file("/var/local/emhttp/var.ini"); $server = strtoupper($var['NAME']); $output = $unraid['notify']['docker_notify']; $info = $DockerTemplates->getAllInfo(true); foreach ($DockerClient->getDockerContainers() as $ct) { $name = $ct['Name']; $image = $ct['Image']; if ($info[$name]['updated'] == "false") { $updateStatus = (is_file($dockerManPaths['update-status'])) ? json_decode(file_get_contents($dockerManPaths['update-status']), TRUE) : []; $new = str_replace('sha256:', '', $updateStatus[$image]['remote']); $new = substr($new, 0, 4).'..'.substr($new, -4, 4); if ( ! isset($nonotify) ) { $event = str_replace("'","'",_("Docker")." - $name [$new]"); $subject = str_replace("'","'",sprintf(_("Notice [%s] - Version update %s"),$server,$new)); $description = str_replace("'","'",sprintf(_("A new version of %s is available"),$name)); exec("$notify -e ".escapeshellarg($event)." -s ".escapeshellarg($subject)." -d ".escapeshellarg($description)." -i ".escapeshellarg("normal $output")." -l '/Docker' -x"); } } } } exit(0); ?>