refactor: move unraid-specific tools into Plugin/unraid/tools/
api_cache_writer, remote_arr_cache_writer, conf_populate, storage_migrate are
all Unraid-adapter-specific — they read Docker appdata paths, Unraid service
configs, and drive the Unraid web plugin cache. They don't belong in Tools/.
- Tools/{4 scripts + php} → Plugin/unraid/tools/
- Fix source depth: ../ → ../../../ (now 3 levels from repo root)
- Fix conf_populate SCRIPTS_ROOT bug: was never set, would expand to empty
- api/arrs.php, api/storage.php: SCRIPTS_DIR/Tools/ → dirname(__DIR__)/tools/
- schedule.json: key IDs updated to Plugin/unraid/tools/...
- Cron rebuilt — live entries updated immediately
This commit is contained in:
@@ -9,7 +9,7 @@ if ($_action === 'refresh_remote') {
|
|||||||
if (!preg_match('/^host\d+$/', $host)) {
|
if (!preg_match('/^host\d+$/', $host)) {
|
||||||
echo json_encode(['ok' => false, 'error' => 'Invalid host']); exit;
|
echo json_encode(['ok' => false, 'error' => 'Invalid host']); exit;
|
||||||
}
|
}
|
||||||
$script = SCRIPTS_DIR . '/Tools/remote_arr_cache_writer.sh';
|
$script = dirname(__DIR__) . '/tools/remote_arr_cache_writer.sh';
|
||||||
if (!file_exists($script)) {
|
if (!file_exists($script)) {
|
||||||
echo json_encode(['ok' => false, 'error' => 'remote_arr_cache_writer.sh not found']); exit;
|
echo json_encode(['ok' => false, 'error' => 'remote_arr_cache_writer.sh not found']); exit;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ if ($action === 'migrate' && $_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$script = SCRIPTS_DIR . '/Tools/storage_migrate.sh';
|
$script = dirname(__DIR__) . '/tools/storage_migrate.sh';
|
||||||
if (!file_exists($script)) {
|
if (!file_exists($script)) {
|
||||||
echo json_encode(['ok' => false, 'error' => 'storage_migrate.sh not found']);
|
echo json_encode(['ok' => false, 'error' => 'storage_migrate.sh not found']);
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@@ -41,7 +41,8 @@
|
|||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
source "$SCRIPT_DIR/../load_config.sh"
|
source "$SCRIPT_DIR/../../../load_config.sh"
|
||||||
|
SCRIPTS_ROOT="$SCRIPTS_DIR"
|
||||||
|
|
||||||
OVERWRITE=false
|
OVERWRITE=false
|
||||||
NO_PUSH=false
|
NO_PUSH=false
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
source "$SCRIPT_DIR/../load_config.sh"
|
source "$SCRIPT_DIR/../../../load_config.sh"
|
||||||
|
|
||||||
parse_args "$@"
|
parse_args "$@"
|
||||||
acquire_lock
|
acquire_lock
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
# ==============================================================================================
|
# ==============================================================================================
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
source "$SCRIPT_DIR/../load_config.sh"
|
source "$SCRIPT_DIR/../../../load_config.sh"
|
||||||
|
|
||||||
parse_args "$@"
|
parse_args "$@"
|
||||||
acquire_lock
|
acquire_lock
|
||||||
Reference in New Issue
Block a user