added icons and improved ux

This commit is contained in:
2026-04-06 01:11:30 +00:00
parent 227cdaac19
commit 9cad6ba306
4 changed files with 119 additions and 70 deletions
+24 -14
View File
@@ -36,13 +36,23 @@ echo "--- $ICON_GEAR Setup ---"
detect_hosts
resolve_remote_ip
# -----------------------------------------------------------------------------------------------
# --- $ICON_SHIELD Pre-flight Checks ---
# -----------------------------------------------------------------------------------------------
echo ""
echo "--- $ICON_SHIELD Pre-flight Checks ---"
check_connectivity
check_remote_rootfs
check_remote_share "$DIRECTORY"
check_remote_disks "$DIRECTORY"
# -----------------------------------------------------------------------------------------------
# Profile is inferred from the directory basename (lowercased)
# e.g. /mnt/user/appdata-Failover/Arrs_Stack → arrs_stack
# -----------------------------------------------------------------------------------------------
echo ""
PROFILE_NAME=$(basename "$DIRECTORY" | tr '[:upper:]' '[:lower:]')
info "$ICON_GEAR Loading profile: $PROFILE_NAME"
@@ -72,9 +82,9 @@ stop_containers
# -----------------------------------------------------------------------------------------------
echo ""
echo "--- $ICON_SYNC Transfer ---"
echo "Source: $DIRECTORY"
echo "Remote: $REMOTE_SERVER:$DIRECTORY"
echo "Profile: $PROFILE_NAME"
echo "$ICON_RUN Source: $DIRECTORY"
echo "$ICON_NET Remote: $REMOTE_SERVER:$DIRECTORY"
echo "$ICON_GEAR Profile: $PROFILE_NAME"
echo ""
get_rsync_opts
@@ -97,7 +107,7 @@ for i in $(seq 1 "$RETRY_COUNT"); do
if rsync "${RSYNC_OPTS[@]}" \
-e "ssh -i $SSH_KEY -T -o Compression=no -o IPQoS=throughput" \
"$DIRECTORY" "root@${REMOTE_SERVER}:$(dirname "$DIRECTORY")/"; then
success "Rsync complete"
echo "$ICON_DONE Rsync complete"
RSYNC_SUCCESS=true
break
else
@@ -107,29 +117,29 @@ for i in $(seq 1 "$RETRY_COUNT"); do
done
# -----------------------------------------------------------------------------------------------
# --- $ICON_RUN Containers ---
# --- $ICON_START Containers ---
# -----------------------------------------------------------------------------------------------
echo ""
echo "--- $ICON_RUN Containers ---"
echo "--- $ICON_START Containers ---"
start_containers
END=$(date +%s)
# -----------------------------------------------------------------------------------------------
# --- Summary ---
# --- $ICON_SUMMARY Summary ---
# -----------------------------------------------------------------------------------------------
echo ""
echo "===== SUMMARY ====="
echo "Directory: $DIRECTORY"
echo "Profile: $PROFILE_NAME"
echo "Duration: $(format_duration $((END - START)))"
echo "===== $ICON_SUMMARY SUMMARY ====="
echo "$ICON_RUN Directory: $DIRECTORY"
echo "$ICON_GEAR Profile: $PROFILE_NAME"
echo "$ICON_TIME Duration: $(format_duration $((END - START)))"
if [[ "$RSYNC_SUCCESS" == true ]]; then
echo "Status: $ICON_SUCCESS DONE"
echo "$ICON_DONE Status: $ICON_SUCCESS DONE"
else
echo "Status: $ICON_ERROR FAILED after $RETRY_COUNT attempts"
echo "$ICON_ERROR Status: $ICON_ERROR FAILED after $RETRY_COUNT attempts"
fi
echo "==================="
echo "========================="
[[ "$RSYNC_SUCCESS" == false ]] && exit 1
exit 0