-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquick-sync.sh
More file actions
executable file
·106 lines (91 loc) · 2.93 KB
/
quick-sync.sh
File metadata and controls
executable file
·106 lines (91 loc) · 2.93 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/bash
# One-Click iPod Sync Launcher
# Double-click this file (or add to Dock) for easy syncing
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "╔════════════════════════════════════════════════════════════╗"
echo "║ PLEX → iPOD SYNC (One-Click Launcher) ║"
echo "╚════════════════════════════════════════════════════════════╝"
echo ""
# Check if iPod is connected
if [ ! -d "/Volumes/IPOD" ]; then
echo "⚠ iPod not detected at /Volumes/IPOD"
echo ""
echo "Searching for iPod..."
# Try to find and mount iPod
IPOD_DISK=$(diskutil list | grep -i "IPOD" | awk '{print $NF}' | head -1)
if [ -n "$IPOD_DISK" ]; then
echo "Found iPod at $IPOD_DISK, mounting..."
diskutil mount "$IPOD_DISK"
sleep 2
else
echo "✗ Could not find iPod"
echo ""
echo "Please:"
echo " 1. Connect your iPod"
echo " 2. Wait for it to appear in Finder"
echo " 3. Run this script again"
echo ""
read -p "Press Enter to exit..."
exit 1
fi
fi
# Verify iPod is now mounted
if [ ! -d "/Volumes/IPOD" ]; then
echo "✗ iPod still not mounted"
read -p "Press Enter to exit..."
exit 1
fi
echo "✓ iPod detected"
echo ""
# Ask for sync mode
echo "Choose sync mode:"
echo " 1) Dry run (preview changes only)"
echo " 2) Full sync (make actual changes)"
echo " 3) Quick sync (no interaction, use saved playlist selections)"
echo ""
read -p "Your choice (1/2/3): " choice
cd "$SCRIPT_DIR"
case $choice in
1)
echo ""
echo "Running DRY RUN..."
echo ""
./sync.sh --dry-run
;;
2)
echo ""
echo "Running FULL SYNC..."
echo ""
./sync.sh
;;
3)
echo ""
echo "Running QUICK SYNC..."
echo ""
./sync.sh --no-interaction
;;
*)
echo "✗ Invalid choice"
read -p "Press Enter to exit..."
exit 1
;;
esac
SYNC_EXIT_CODE=$?
echo ""
echo "════════════════════════════════════════════════════════════"
if [ $SYNC_EXIT_CODE -eq 0 ]; then
echo "✓ SYNC COMPLETE!"
echo ""
echo "Do you want to eject your iPod?"
read -p "(y/n): " eject_choice
if [ "$eject_choice" = "y" ] || [ "$eject_choice" = "Y" ]; then
diskutil unmount /Volumes/IPOD
echo "✓ iPod ejected safely. You can disconnect it now."
else
echo "iPod still mounted. Eject manually when ready."
fi
else
echo "✗ Sync failed. Check errors above."
fi
echo ""
read -p "Press Enter to close..."