-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsync_settings.sh
More file actions
46 lines (39 loc) · 1.14 KB
/
Copy pathsync_settings.sh
File metadata and controls
46 lines (39 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# SkyTrackVision - AirSim Settings Sync Script (Linux/macOS)
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SOURCE_FILE="$PROJECT_ROOT/settings.json"
AIRSIM_DIR="$HOME/Documents/AirSim"
DEST_FILE="$AIRSIM_DIR/settings.json"
echo "🔄 SkyTrackVision - Settings Sync"
echo ""
# AirSim dizinini oluştur (yoksa)
if [ ! -d "$AIRSIM_DIR" ]; then
echo "📁 Creating AirSim directory: $AIRSIM_DIR"
mkdir -p "$AIRSIM_DIR"
fi
# Source dosya kontrolü
if [ ! -f "$SOURCE_FILE" ]; then
echo "❌ Source file not found: $SOURCE_FILE"
exit 1
fi
# Backup oluştur
if [ -f "$DEST_FILE" ]; then
BACKUP_FILE="$DEST_FILE.backup_$(date +%Y%m%d_%H%M%S)"
echo "💾 Backing up existing settings: $(basename $BACKUP_FILE)"
cp "$DEST_FILE" "$BACKUP_FILE"
fi
# Kopyala
echo "📋 Copying settings.json..."
cp "$SOURCE_FILE" "$DEST_FILE"
# Doğrula
if [ -f "$DEST_FILE" ]; then
echo "✅ Settings synced successfully!"
echo ""
echo "Source: $SOURCE_FILE"
echo "Destination: $DEST_FILE"
echo ""
echo "⚠️ You may need to restart AirSim!"
else
echo "❌ Failed to sync settings!"
exit 1
fi