Files
Athena-Deck/integrations/librechat-unraid/nodes/setup-functions.php
T

5 lines
379 B
PHP

<?php
function cmd($a){$p=proc_open($a,[1=>['pipe','w'],2=>['pipe','w']],$ps);$o=stream_get_contents($ps[1]);$e=stream_get_contents($ps[2]);foreach($ps as $s)fclose($s);return [proc_close($p),$o,$e];}
function checked($a){[$c,$o,$e]=cmd($a);if($c)throw new Exception('Command failed, exit '.$c);return $o;}
function protectedFile($p,$s){file_put_contents($p,$s);chmod($p,0600);}