2024-08-26 22:16:55 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# Create folders for fstab
|
|
|
|
# Array of directories to create
|
|
|
|
directories=(
|
|
|
|
# Setup home dir
|
|
|
|
~/Applications
|
|
|
|
~/Developer/Projects
|
|
|
|
~/Developer/UnrealEngine/Engine
|
|
|
|
~/Developer/UnrealEngine/Vault
|
|
|
|
~/Games/SSD
|
|
|
|
~/Games/HDD
|
|
|
|
~/Notes
|
|
|
|
~/.virtualization
|
|
|
|
~/.virtualization/storage/ssd
|
|
|
|
~/.virtualization/storage/hdd
|
|
|
|
~/.virtualization/storage/installer
|
|
|
|
|
|
|
|
/mnt/storage
|
|
|
|
# Custom folders
|
|
|
|
/mnt/storage/.fstab/Projects
|
|
|
|
/mnt/storage/.fstab/Engine
|
|
|
|
/mnt/storage/.fstab/Vault
|
|
|
|
/mnt/storage/.fstab/Games
|
|
|
|
/mnt/storage/.fstab/virtualization/hdd
|
|
|
|
/mnt/storage/.fstab/virtualization/installer
|
|
|
|
|
|
|
|
# Default Folders
|
|
|
|
/mnt/storage/.fstab/Downloads
|
|
|
|
/mnt/storage/.fstab/Music
|
|
|
|
/mnt/storage/.fstab/Pictures
|
|
|
|
/mnt/storage/.fstab/Videos
|
|
|
|
)
|
|
|
|
|
|
|
|
# Iterate over the array and create each directory if it doesn't exist
|
|
|
|
for dir in "${directories[@]}"; do
|
|
|
|
mkdir -p "$dir"
|
|
|
|
done
|
|
|
|
|
|
|
|
# Create links
|
|
|
|
|
|
|
|
# Array of lines to add to /etc/fstab
|
|
|
|
fstab_entries=(
|
2025-01-16 03:00:41 +01:00
|
|
|
"/mnt/storage/.fstab/Projects /home/boo3/Applications none bind 0 0"
|
|
|
|
"/mnt/storage/.fstab/Engine /home/boo3/Developer/UnrealEngine/Engine none bind 0 0"
|
|
|
|
"/mnt/storage/.fstab/Vault /home/boo3/Developer/UnrealEngine/Vault none bind 0 0"
|
|
|
|
"/mnt/storage/.fstab/Games /home/boo3/Games/HDD none bind 0 0"
|
|
|
|
"/mnt/storage/.fstab/virtualization/hdd /home/boo3/.virtualization/storage/hdd none bind 0 0"
|
|
|
|
"/mnt/storage/.fstab/virtualization/installer /home/boo3/.virtualization/storage/installer none bind 0 0"
|
|
|
|
"/mnt/storage/.fstab/Downloads /home/boo3/Downloads none bind 0 0"
|
|
|
|
"/mnt/storage/.fstab/Music /home/boo3/Music none bind 0 0"
|
|
|
|
"/mnt/storage/.fstab/Pictures /home/boo3/Pictures none bind 0 0"
|
|
|
|
"/mnt/storage/.fstab/Videos /home/boo3/Videos none bind 0 0"
|
2024-08-26 22:16:55 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
# Iterate over the array and add each entry to /etc/fstab if it doesn't already exist
|
|
|
|
for entry in "${fstab_entries[@]}"; do
|
|
|
|
if ! grep -qF "$entry" /etc/fstab; then
|
|
|
|
echo "$entry" | sudo tee -a /etc/fstab > /dev/null
|
|
|
|
echo "Added entry: $entry"
|
|
|
|
else
|
|
|
|
echo "Entry already exists: $entry"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
sudo reboot
|