Files
Athena-Deck/integrations/librechat-unraid/nodes/set-autostart.php
T

3 lines
525 B
PHP

<?php
$p='/var/lib/docker/unraid-autostart';$s=file_get_contents($p);$names=['LibreChat-Code-Redis','LibreChat-Code-API','LibreChat-Code-HTTPS','LibreChat-Unraid-Worker'];$lines=explode("\n",trim($s));$lines=array_values(array_filter($lines,fn($l)=>!in_array(trim(explode(' ',$l)[0]),$names)));$out=[];foreach($lines as$l){if(trim(explode(' ',$l)[0])==='LibreChat')foreach($names as$n)$out[]=$n;$out[]=$l;}file_put_contents($p,implode("\n",$out)."\n");echo "Own worker services added before LibreChat in Unraid autostart\n";