Compare commits

..
7 Commits
Author SHA1 Message Date
abrown38 c4a36c0cd4 remove duplicate code and update error message 2026-08-13 10:08:02 +01:00
abrown38 0487eb1c0c lowercase directory names to match old serv-u 2026-04-21 15:20:15 +01:00
abrown38 1464774831 replace symlinks 2026-04-16 11:30:21 +01:00
abrown38 89d27a2e86 add space project and domain files 2026-04-16 11:29:06 +01:00
abrown38 a12f8a203c fix directory name 2026-04-16 11:28:56 +01:00
abrown38 3fa36c6e22 added gitignore 2026-04-16 11:28:35 +01:00
abrown38 678afed315 shellcheck fixes 2026-04-16 11:27:43 +01:00
4 changed files with 22 additions and 12 deletions

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
log/
emails/
+4
View File
@@ -0,0 +1,4 @@
eidfsp02-sgstd
eidfsp04-sgpro
eidfsp03-sgprodev
eidfsp01-sgstddev
+11
View File
@@ -0,0 +1,11 @@
eidf130 standard
eidf142 standard
eidf138 standard
eidf092 standard
eidf184 standard
eidfsp02-sgstd standard
eidfsp04-sgpro protected
eidfsp03-sgprodev protected
eidf017 standard
eidf092 standard
eidfsp01-sgstddev standard
+5 -12
View File
@@ -12,12 +12,12 @@ function main() {
# Files uploaded to serv-u
local SERVU_BASE="/mnt/os-transfer"
local IMPORT_DIR="$SERVU_BASE/space-landing/Import"
local EXPORT_DIR="$SERVU_BASE/space-landing/Export"
local IMPORT_DIR="$SERVU_BASE/space-landing/import"
local EXPORT_DIR="$SERVU_BASE/space-landing/export"
local LIN_DIR="/mnt/linux"
local WIN_DIR="/mnt/windows"
[[ -d "/opt/os-transfer" ]] && cd "/opt/os-transfer"
cd "/opt/os-transfer" || { echo "Cannot cd to /opt/os-transfer"; exit; }
local SPACE_PROJECT_MAP="./space-project-map"
[[ -f "$SPACE_PROJECT_MAP" ]] || \
@@ -96,19 +96,12 @@ function transfer::import() {
local file=${filepath##*/} # strip directories from path
# ensure file has correct format
if [[ ! "$file" =~ ^eidf[a-zA-Z0-9]{2,5}-[a-zA-Z0-9]{3,8}-.+$ ]]; then
logging::failure "[IMPORT] $file — Filename format invalid"
continue
fi
# Ensure filename matches expected format
if [[ ! "$file" =~ ^eidf[a-zA-Z0-9]{2,5}-[a-zA-Z0-9]{3,8}-.+ ]]; then
logging::failure "[IMPORT] $file — Filename format invalid"
if [[ ! "$file" =~ ^eidf[a-zA-Z0-9]{2,5}-[a-zA-Z0-9]{3,8}-.+$ ]]; then
logging::failure "[IMPORT] $file — eidf prefix wrong or missing"
continue
fi
# example file: eidf123-abc01-file.csv
local project="${file%%-*}" # eidf123
local rest="${file#*-}" # abc01-file.csv