diff --git a/Plugin/unraid/include/config.php b/Plugin/unraid/include/config.php index f27f526..190a376 100644 --- a/Plugin/unraid/include/config.php +++ b/Plugin/unraid/include/config.php @@ -37,7 +37,15 @@ function vv_push_master_conf(): array { continue; } - $dest = escapeshellarg('root@' . $ip . ':' . CONF_DIR . '/master.conf'); + // Query the remote's varaverk.cfg so we SCP to their actual SCRIPTS_DIR, + // not ours — they may use a different appdata path (e.g. /mnt/cache vs /mnt/user). + $sshBase = 'ssh -i ' . escapeshellarg($sshKey) + . ' -o ConnectTimeout=10 -o StrictHostKeyChecking=no root@' . $ip; + $remoteCfg = trim(shell_exec($sshBase . ' "grep SCRIPTS_DIR /boot/config/plugins/varaverk/varaverk.cfg 2>/dev/null"') ?: ''); + preg_match('/SCRIPTS_DIR\s*=\s*["\']?([^"\']+)["\']?/', $remoteCfg, $sm); + $remoteConf = rtrim($sm[1] ?? '/mnt/user/appdata/Varaverk', '/') . '/Configurations'; + + $dest = escapeshellarg('root@' . $ip . ':' . $remoteConf . '/master.conf'); $cmd = 'scp -i ' . escapeshellarg($sshKey) . ' -o ConnectTimeout=10 -o StrictHostKeyChecking=no' . ' ' . escapeshellarg($localPath) . ' ' . $dest . ' 2>&1';