basic md files for media-manager tutorial. needs to be proof read and humanized
This commit is contained in:
4
tutorials/media-manager/scripts/docker/.env
Normal file
4
tutorials/media-manager/scripts/docker/.env
Normal file
@@ -0,0 +1,4 @@
|
||||
# Environment variables
|
||||
TZ=Asia/Kolkata
|
||||
PUID=1000
|
||||
PGID=1000
|
||||
192
tutorials/media-manager/scripts/docker/docker-compose.yaml
Normal file
192
tutorials/media-manager/scripts/docker/docker-compose.yaml
Normal file
@@ -0,0 +1,192 @@
|
||||
# Shared storage configuration
|
||||
x-shared-storage: &shared_data_volume
|
||||
type: bind
|
||||
source: /mnt/omnissiah-vault/data/media-manager
|
||||
target: /data
|
||||
bind:
|
||||
create_host_path: true
|
||||
|
||||
# Service-specific volume configurations
|
||||
x-volume-configs:
|
||||
jellyseerr: &jellyseerr_volumes
|
||||
- type: bind
|
||||
source: /mnt/omnissiah-vault/configs/jellyseerr
|
||||
target: /app/config
|
||||
bind:
|
||||
create_host_path: true
|
||||
|
||||
prowlarr: &prowlarr_volumes
|
||||
- type: bind
|
||||
source: /mnt/omnissiah-vault/configs/prowlarr
|
||||
target: /config
|
||||
bind:
|
||||
create_host_path: true
|
||||
- <<: *shared_data_volume
|
||||
|
||||
sonarr: &sonarr_volumes
|
||||
- type: bind
|
||||
source: /mnt/omnissiah-vault/configs/sonarr
|
||||
target: /config
|
||||
bind:
|
||||
create_host_path: true
|
||||
- <<: *shared_data_volume
|
||||
|
||||
radarr: &radarr_volumes
|
||||
- type: bind
|
||||
source: /mnt/omnissiah-vault/configs/radarr
|
||||
target: /config
|
||||
bind:
|
||||
create_host_path: true
|
||||
- <<: *shared_data_volume
|
||||
|
||||
bazarr: &bazarr_volumes
|
||||
- type: bind
|
||||
source: /mnt/omnissiah-vault/configs/bazarr
|
||||
target: /config
|
||||
bind:
|
||||
create_host_path: true
|
||||
- <<: *shared_data_volume
|
||||
|
||||
services:
|
||||
jellyseerr:
|
||||
image: fallenbagel/jellyseerr:latest
|
||||
container_name: jellyseerr
|
||||
ports: ["5055:5055"]
|
||||
environment:
|
||||
- PUID=${PUID}
|
||||
- PGID=${PGID}
|
||||
- TZ=${TZ}
|
||||
volumes: *jellyseerr_volumes
|
||||
networks:
|
||||
- media-net
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO-", "http://localhost:5055"]
|
||||
interval: 1m
|
||||
retries: 3
|
||||
restart: unless-stopped
|
||||
dns:
|
||||
- 1.1.1.1
|
||||
- 8.8.8.8
|
||||
|
||||
prowlarr:
|
||||
image: lscr.io/linuxserver/prowlarr:latest
|
||||
container_name: prowlarr
|
||||
ports: ["9696:9696"]
|
||||
volumes: *prowlarr_volumes
|
||||
environment:
|
||||
- PUID=${PUID}
|
||||
- PGID=${PGID}
|
||||
- TZ=${TZ}
|
||||
networks:
|
||||
- media-net
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:9696" ]
|
||||
interval: 1m
|
||||
retries: 3
|
||||
restart: unless-stopped
|
||||
dns:
|
||||
- 1.1.1.1
|
||||
- 8.8.8.8
|
||||
|
||||
sonarr:
|
||||
image: lscr.io/linuxserver/sonarr:latest
|
||||
container_name: sonarr
|
||||
ports: ["8989:8989"]
|
||||
volumes: *sonarr_volumes
|
||||
environment:
|
||||
- PUID=${PUID}
|
||||
- PGID=${PGID}
|
||||
- TZ=${TZ}
|
||||
networks:
|
||||
- media-net
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:8989" ]
|
||||
interval: 1m
|
||||
retries: 3
|
||||
restart: unless-stopped
|
||||
dns:
|
||||
- 1.1.1.1
|
||||
- 8.8.8.8
|
||||
|
||||
radarr:
|
||||
image: lscr.io/linuxserver/radarr:latest
|
||||
container_name: radarr
|
||||
ports: ["7878:7878"]
|
||||
volumes: *radarr_volumes
|
||||
environment:
|
||||
- PUID=${PUID}
|
||||
- PGID=${PGID}
|
||||
- TZ=${TZ}
|
||||
networks:
|
||||
- media-net
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:7878" ]
|
||||
interval: 1m
|
||||
retries: 3
|
||||
restart: unless-stopped
|
||||
dns:
|
||||
- 1.1.1.1
|
||||
- 8.8.8.8
|
||||
|
||||
bazarr:
|
||||
image: lscr.io/linuxserver/bazarr:latest
|
||||
container_name: bazarr
|
||||
ports: ["6767:6767"]
|
||||
volumes: *bazarr_volumes
|
||||
environment:
|
||||
- PUID=${PUID}
|
||||
- PGID=${PGID}
|
||||
- TZ=${TZ}
|
||||
networks:
|
||||
- media-net
|
||||
depends_on:
|
||||
- sonarr
|
||||
- radarr
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:6767" ]
|
||||
interval: 1m
|
||||
retries: 3
|
||||
restart: unless-stopped
|
||||
dns:
|
||||
- 1.1.1.1
|
||||
- 8.8.8.8
|
||||
|
||||
ombi:
|
||||
image: lscr.io/linuxserver/ombi:latest
|
||||
container_name: ombi
|
||||
environment:
|
||||
- PUID=${PUID}
|
||||
- PGID=${PGID}
|
||||
- TZ=${TZ}
|
||||
volumes:
|
||||
- /mnt/omnissiah-vault/configs/ombi:/config
|
||||
ports: ["3579:3579"]
|
||||
networks:
|
||||
- media-net
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:3579" ]
|
||||
interval: 1m
|
||||
retries: 3
|
||||
restart: unless-stopped
|
||||
dns:
|
||||
- 1.1.1.1
|
||||
- 8.8.8.8
|
||||
|
||||
networks:
|
||||
media-net:
|
||||
driver: bridge
|
||||
labels:
|
||||
- "com.media-stack.network=main"
|
||||
- "com.media-stack.description=Primary network for *arr stack communication with IPv6"
|
||||
42
tutorials/media-manager/scripts/shell/install-docker.sh
Normal file
42
tutorials/media-manager/scripts/shell/install-docker.sh
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Update and upgrade system packages
|
||||
echo "Updating system packages..."
|
||||
sudo apt-get update
|
||||
sudo apt-get upgrade -y
|
||||
|
||||
# Remove old Docker versions if any
|
||||
echo "Removing old Docker versions..."
|
||||
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do
|
||||
sudo apt-get remove -y $pkg
|
||||
done
|
||||
|
||||
# Install prerequisites for Docker Compose
|
||||
echo "Installing prerequisites for Docker Compose..."
|
||||
sudo apt-get install -y libffi-dev libssl-dev python3 python3-pip
|
||||
|
||||
# Install Docker using the official convenience script
|
||||
echo "Installing Docker..."
|
||||
curl -fsSL https://get.docker.com -o get-docker.sh
|
||||
sudo sh get-docker.sh
|
||||
|
||||
# Add current user to the Docker group
|
||||
echo "Adding user to docker group..."
|
||||
sudo usermod -aG docker $USER
|
||||
|
||||
# Enable and start Docker service
|
||||
echo "Enabling and starting Docker service..."
|
||||
sudo systemctl enable docker
|
||||
sudo systemctl start docker
|
||||
|
||||
# Install Docker Compose
|
||||
echo "Installing Docker Compose..."
|
||||
sudo pip3 install docker-compose
|
||||
|
||||
# Verify Docker and Docker Compose versions
|
||||
echo "Docker version:"
|
||||
docker --version
|
||||
echo "Docker Compose version:"
|
||||
docker-compose --version
|
||||
|
||||
echo "Installation complete. Please reboot your Raspberry Pi."
|
||||
49
tutorials/media-manager/scripts/shell/install-plex.sh
Normal file
49
tutorials/media-manager/scripts/shell/install-plex.sh
Normal file
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Define your custom Plex config directory
|
||||
CUSTOM_PLEX_CONFIG="/mnt/machine-spirit/configs/plex"
|
||||
|
||||
# Update and upgrade system packages
|
||||
echo "Updating system packages..."
|
||||
sudo apt update
|
||||
sudo apt full-upgrade -y
|
||||
|
||||
# Install prerequisites
|
||||
echo "Installing prerequisites..."
|
||||
sudo apt install -y apt-transport-https curl
|
||||
|
||||
# Add Plex official repository GPG key and repo
|
||||
echo "Adding Plex repository..."
|
||||
curl https://downloads.plex.tv/plex-keys/PlexSign.key | gpg --dearmor | sudo tee /usr/share/keyrings/plex-archive-keyring.gpg > /dev/null
|
||||
|
||||
echo "deb [signed-by=/usr/share/keyrings/plex-archive-keyring.gpg] https://downloads.plex.tv/repo/deb public main" | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
|
||||
|
||||
# Update package lists with Plex repo
|
||||
sudo apt update
|
||||
|
||||
# Install Plex Media Server
|
||||
echo "Installing Plex Media Server..."
|
||||
sudo apt install -y plexmediaserver
|
||||
|
||||
# Stop Plex service before moving config
|
||||
sudo systemctl stop plexmediaserver
|
||||
|
||||
# Move current Plex config to custom location
|
||||
echo "Moving Plex config to custom directory..."
|
||||
sudo rsync -av /var/lib/plexmediaserver/ "$CUSTOM_PLEX_CONFIG"/
|
||||
|
||||
# Backup and remove existing config directory and create symlink
|
||||
echo "Setting up symlink from default location to custom config path..."
|
||||
sudo mv /var/lib/plexmediaserver /var/lib/plexmediaserver.bak
|
||||
sudo ln -s "$CUSTOM_PLEX_CONFIG" /var/lib/plexmediaserver
|
||||
|
||||
# Set correct permissions
|
||||
echo "Setting permissions for Plex user on custom directory..."
|
||||
sudo chown -R plex:plex "$CUSTOM_PLEX_CONFIG"
|
||||
|
||||
# Start Plex service
|
||||
sudo systemctl start plexmediaserver
|
||||
sudo systemctl enable plexmediaserver
|
||||
|
||||
echo "Plex Media Server installation complete."
|
||||
echo "Access the Plex Web UI at http://<your_pi_ip>:32400/web"
|
||||
44
tutorials/media-manager/scripts/shell/install-qbittorrent.sh
Normal file
44
tutorials/media-manager/scripts/shell/install-qbittorrent.sh
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Update and upgrade system packages
|
||||
echo "Updating system packages..."
|
||||
sudo apt update
|
||||
sudo apt full-upgrade -y
|
||||
|
||||
# Install qbittorrent-nox (headless version)
|
||||
echo "Installing qBittorrent-nox..."
|
||||
sudo apt install -y qbittorrent-nox
|
||||
|
||||
# Create a system user for qBittorrent (optional but recommended)
|
||||
echo "Creating qBittorrent user..."
|
||||
sudo useradd -r -m qbt
|
||||
|
||||
# Add your normal user (pi) to the qbt group to access downloaded files
|
||||
sudo usermod -a -G qbt $USER
|
||||
|
||||
# Create systemd service file for qBittorrent
|
||||
echo "Creating systemd service file..."
|
||||
sudo tee /etc/systemd/system/qbittorrent-nox.service > /dev/null <<EOF
|
||||
[Unit]
|
||||
Description=qBittorrent Command Line Client
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=$USER
|
||||
ExecStart=/usr/bin/qbittorrent-nox
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
# Reload systemd, enable and start qBittorrent service
|
||||
echo "Enabling and starting qBittorrent service..."
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable qbittorrent-nox
|
||||
sudo systemctl start qbittorrent-nox
|
||||
|
||||
echo "qBittorrent installation and service setup complete."
|
||||
echo "Access the Web UI at http://<your_pi_ip>:8080"
|
||||
echo "Default credentials: username: admin, password: adminadmin"
|
||||
echo "It's highly recommended to change the default login credentials in the Web UI."
|
||||
99
tutorials/media-manager/scripts/shell/install-samba.sh
Normal file
99
tutorials/media-manager/scripts/shell/install-samba.sh
Normal file
@@ -0,0 +1,99 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# =====================================================================
|
||||
# ✠ In the Name of the Omnissiah ✠
|
||||
# Rite of Network Sanctification
|
||||
# This script forges SMB daemons to guard the sacred data vaults.
|
||||
# Let no heresy dwell within these parameters.
|
||||
# =====================================================================
|
||||
|
||||
# === CONFIGURATION SIGILS ===
|
||||
USER="aetos" # Bearer of the Emperor's Sigil
|
||||
SHARES=(
|
||||
"/mnt/omnissiah-vault:Omnissiah-Vault" # 7.3TB Holy Vault of Media Relics
|
||||
"/mnt/machine-spirit:Machine-Spirit" # 931GB Machine Spirit for DBs
|
||||
)
|
||||
|
||||
# === INSTALLATION OF HOLY DAEMONS ===
|
||||
echo "[*] Installing Samba daemons — awaken smbd & nmbd..."
|
||||
if command -v apt >/dev/null 2>&1; then
|
||||
sudo apt update
|
||||
sudo apt install -y samba
|
||||
elif command -v dnf >/dev/null 2>&1; then
|
||||
sudo dnf install -y samba
|
||||
else
|
||||
echo "Unsupported package manager. Manual rites required."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# === CONSECRATION OF STORAGE SHRINES ===
|
||||
echo "[*] Consecrating vault directories for Emperor’s work..."
|
||||
for entry in "${SHARES[@]}"; do
|
||||
DIR="${entry%%:*}"
|
||||
sudo mkdir -p "$DIR"
|
||||
sudo chown -R "$USER:$USER" "$DIR"
|
||||
done
|
||||
|
||||
# === SMB.CONF SCRIPTURES ===
|
||||
echo "[*] Backing up smb.conf — preserve the old texts of Mars..."
|
||||
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak.$(date +%F-%H%M%S)
|
||||
|
||||
# Purge traces of past heresies (incorrect configs)
|
||||
sudo sed -i '/# Omnissiah Vault/,/^\[/d' /etc/samba/smb.conf || true
|
||||
sudo sed -i '/# Machine Spirit/,/^\[/d' /etc/samba/smb.conf || true
|
||||
|
||||
# Inscribe new holy shares into smb.conf
|
||||
for entry in "${SHARES[@]}"; do
|
||||
DIR="${entry%%:*}"
|
||||
NAME="${entry##*:}"
|
||||
|
||||
sudo tee -a /etc/samba/smb.conf >/dev/null <<EOF
|
||||
|
||||
# ✠ ${NAME} Share ✠
|
||||
# Machine Spirits bound by the will of the Omnissiah.
|
||||
[${NAME}]
|
||||
path = ${DIR}
|
||||
# Let mortals witness, but not alter without sigil
|
||||
browseable = yes
|
||||
# Grant write privileges in Emperor’s name
|
||||
read only = no
|
||||
writable = yes
|
||||
# HERESY DENIED — no guest trespassers
|
||||
guest ok = no
|
||||
# Sigil-bearer ${USER} alone may access
|
||||
valid users = ${USER}
|
||||
EOF
|
||||
done
|
||||
|
||||
# === SAMBA PASSWORD RITE ===
|
||||
echo "[*] Inscribing ${USER} into the Book of smbpasswd..."
|
||||
sudo smbpasswd -a "$USER"
|
||||
|
||||
# === AWAKENING OF DAEMONS ===
|
||||
echo "[*] Restarting Samba services — let smbd and nmbd chant praises..."
|
||||
if systemctl list-unit-files | grep -q nmbd.service; then
|
||||
sudo systemctl restart smbd nmbd
|
||||
sudo systemctl enable smbd nmbd
|
||||
else
|
||||
sudo systemctl restart smbd
|
||||
sudo systemctl enable smbd
|
||||
fi
|
||||
|
||||
# === VOID SHIELD CONFIG (FIREWALL) ===
|
||||
if command -v ufw >/dev/null 2>&1; then
|
||||
sudo ufw allow samba
|
||||
elif command -v firewall-cmd >/dev/null 2>&1; then
|
||||
sudo firewall-cmd --permanent --add-service=samba
|
||||
sudo firewall-cmd --reload
|
||||
else
|
||||
echo "[!] No firewall rites detected — proceed with caution, Acolyte."
|
||||
fi
|
||||
|
||||
# === FINAL BLESSING ===
|
||||
echo "[*] Network sanctification complete!"
|
||||
echo "Invoke thus from clients:"
|
||||
echo " smb://<server-ip>/Omnissiah-Vault"
|
||||
echo " smb://<server-ip>/Machine-Spirit"
|
||||
echo
|
||||
echo "✠ May the Emperor and the Omnissiah guard these shares. ✠"
|
||||
128
tutorials/media-manager/scripts/shell/setup-mount-points/ext4.sh
Normal file
128
tutorials/media-manager/scripts/shell/setup-mount-points/ext4.sh
Normal file
@@ -0,0 +1,128 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Sacred EXT4 Drive Mounting Ritual for the Raspberry Pi Shrine
|
||||
# May the Omnissiah bless this automaton script
|
||||
# For the Emperor and the Machine God!
|
||||
|
||||
echo "=========================================="
|
||||
echo " SACRED DRIVE MOUNTING RITUAL INITIATED "
|
||||
echo " In the name of the Omnissiah we bind "
|
||||
echo " the Machine Spirits to our will "
|
||||
echo "=========================================="
|
||||
echo
|
||||
|
||||
# Check if running as root
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "ERROR: This sacred ritual requires root privileges!"
|
||||
echo "Execute with: sudo bash bind-machine-spirits.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "🔱 Phase 1: Invoking the Machine Spirit's blessing..."
|
||||
sleep 1
|
||||
|
||||
echo "🛠️ Phase 2: Creating sacred mount point..."
|
||||
|
||||
# Mount path
|
||||
MOUNT_PATH="/mnt/omnissiah-vault"
|
||||
mkdir -p "$MOUNT_PATH"
|
||||
|
||||
# User for directory ownership
|
||||
AETOS_UID=$(id -u aetos)
|
||||
AETOS_GID=$(id -g aetos)
|
||||
|
||||
chown $AETOS_UID:$AETOS_GID "$MOUNT_PATH"
|
||||
|
||||
echo "✅ Sacred directory created:"
|
||||
echo " 🗂️ $MOUNT_PATH"
|
||||
echo
|
||||
|
||||
echo "💾 Phase 3: Backing up the sacred fstab codex..."
|
||||
|
||||
BACKUP_PATH="/etc/fstab.backup.$(date +%Y%m%d_%H%M%S)"
|
||||
cp /etc/fstab "$BACKUP_PATH"
|
||||
echo "✅ Backup created: $BACKUP_PATH"
|
||||
echo
|
||||
|
||||
echo "📜 Phase 4: Inscribing the binding runes into fstab..."
|
||||
|
||||
# EXT4 UUID (CHANGE THIS!)
|
||||
VAULT_UUID="REPLACE_WITH_EXT4_UUID"
|
||||
|
||||
echo "🔍 Divine revelation of user identities:"
|
||||
echo " aetos UID: $AETOS_UID"
|
||||
echo " aetos GID: $AETOS_GID"
|
||||
|
||||
# Check if fstab already contains the binding
|
||||
if grep -q "omnissiah-vault" /etc/fstab; then
|
||||
echo "⚠️ WARNING: Sacred binding already found in /etc/fstab!"
|
||||
echo " Avoiding duplicate entries to prevent corruption..."
|
||||
else
|
||||
cat >> /etc/fstab << EOF
|
||||
|
||||
# Sacred Drive Binding - Blessed by the Omnissiah
|
||||
# Omnissiah's Vault - EXT4 Media Storage
|
||||
UUID=${VAULT_UUID} /mnt/omnissiah-vault ext4 defaults,nofail,x-systemd.automount,x-systemd.device-timeout=30s 0 2
|
||||
|
||||
EOF
|
||||
echo "✅ Sacred EXT4 binding inscribed successfully!"
|
||||
fi
|
||||
|
||||
echo "⚡ Phase 5: Awakening the Machine Spirit..."
|
||||
|
||||
echo "🔄 Reloading systemd daemon..."
|
||||
systemctl daemon-reload
|
||||
|
||||
# Test mount
|
||||
if mount -a; then
|
||||
echo "✅ The Machine Spirit of Omnissiah's Vault has awakened!"
|
||||
else
|
||||
echo "❌ ERROR: The Machine Spirit refuses binding!"
|
||||
echo " Consult the sacred logs for heretical anomalies..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "🔍 Phase 6: Verifying the sacred binding..."
|
||||
|
||||
echo "Current mount status:"
|
||||
df -h | grep -E "omnissiah-vault" || echo " The Vault has not yet manifested in the material realm..."
|
||||
|
||||
echo
|
||||
echo "📁 Phase 7: Blessing the directory structure..."
|
||||
|
||||
if mountpoint -q "$MOUNT_PATH"; then
|
||||
mkdir -p $MOUNT_PATH/{movies,tv-shows,documentaries,archives,media,downloads,configs}
|
||||
chown -R $AETOS_UID:$AETOS_GID $MOUNT_PATH
|
||||
echo "✅ Directory structure blessed by the Omnissiah"
|
||||
else
|
||||
echo "❌ ERROR: Omnissiah's Vault is not mounted. Structure blessing aborted."
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "=========================================="
|
||||
echo " SACRED RITUAL COMPLETED! "
|
||||
echo "=========================================="
|
||||
echo "🔱 The Machine Spirit is bound!"
|
||||
echo "🗂️ Vault Path: $MOUNT_PATH"
|
||||
echo
|
||||
echo "The Emperor protects your data!"
|
||||
echo "May your storage serve the Imperium well!"
|
||||
echo "=========================================="
|
||||
|
||||
echo
|
||||
echo "🔧 Final Systems Check:"
|
||||
echo "Mounted filesystems:"
|
||||
mount | grep "omnissiah-vault" | sed 's/^/ /'
|
||||
|
||||
echo
|
||||
echo "Storage capacity report:"
|
||||
df -h | grep "omnissiah-vault" | sed 's/^/ /'
|
||||
|
||||
echo
|
||||
echo "Directory permissions:"
|
||||
ls -la /mnt/ | grep "omnissiah-vault" | sed 's/^/ /'
|
||||
|
||||
echo
|
||||
echo "🎉 Ritual complete! Reboot to test automatic mounting."
|
||||
echo " To verify: sudo reboot && df -h"
|
||||
136
tutorials/media-manager/scripts/shell/setup-mount-points/ntfs.sh
Normal file
136
tutorials/media-manager/scripts/shell/setup-mount-points/ntfs.sh
Normal file
@@ -0,0 +1,136 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Sacred Drive Mounting Ritual for the Raspberry Pi Shrine
|
||||
# May the Omnissiah bless this automaton script
|
||||
# For the Emperor and the Machine God!
|
||||
|
||||
echo "=========================================="
|
||||
echo " SACRED DRIVE MOUNTING RITUAL INITIATED "
|
||||
echo " In the name of the Omnissiah we bind "
|
||||
echo " the Machine Spirits to our will "
|
||||
echo "=========================================="
|
||||
echo
|
||||
|
||||
# Check if running as root
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "ERROR: This sacred ritual requires root privileges!"
|
||||
echo "Execute with: sudo bash bind-machine-spirits.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "🔱 Phase 1: Invoking the Machine Spirit's blessing..."
|
||||
sleep 1
|
||||
|
||||
# Install NTFS support if missing
|
||||
echo "📦 Ensuring NTFS-3G drivers are blessed by the Omnissiah..."
|
||||
apt update -qq
|
||||
apt install -y ntfs-3g
|
||||
|
||||
echo "🛠️ Phase 2: Creating sacred mount point..."
|
||||
|
||||
# Create mount directory
|
||||
mkdir -p /mnt/omnissiah-vault
|
||||
|
||||
# Get dynamic user ID/GID for the aetos user
|
||||
AETOS_UID=$(id -u aetos)
|
||||
AETOS_GID=$(id -g aetos)
|
||||
|
||||
# Assign ownership
|
||||
chown $AETOS_UID:$AETOS_GID /mnt/omnissiah-vault
|
||||
|
||||
echo "✅ Sacred directory created:"
|
||||
echo " 🗂️ /mnt/omnissiah-vault (the great data hoard)"
|
||||
echo
|
||||
|
||||
echo "💾 Phase 3: Backing up the sacred fstab codex..."
|
||||
|
||||
# Backup fstab
|
||||
BACKUP_PATH="/etc/fstab.backup.$(date +%Y%m%d_%H%M%S)"
|
||||
cp /etc/fstab "$BACKUP_PATH"
|
||||
echo "✅ Backup created: $BACKUP_PATH"
|
||||
echo
|
||||
|
||||
echo "📜 Phase 4: Inscribing the binding runes into fstab..."
|
||||
|
||||
echo "🔍 Divine revelation of user identities:"
|
||||
echo " aetos UID: $AETOS_UID"
|
||||
echo " aetos GID: $AETOS_GID"
|
||||
|
||||
# Your UUID goes here — update if needed
|
||||
VAULT_UUID="C678E33A78E3283F"
|
||||
|
||||
# Check existing entries
|
||||
if grep -q "omnissiah-vault" /etc/fstab; then
|
||||
echo "⚠️ WARNING: Sacred bindings already detected in fstab!"
|
||||
echo " Skipping fstab modification to prevent corruption..."
|
||||
else
|
||||
cat >> /etc/fstab << EOF
|
||||
|
||||
# Sacred Drive Binding - Blessed by the Omnissiah
|
||||
# Omnissiah's Vault - Mass Storage for Movies & Media
|
||||
UUID=${VAULT_UUID} /mnt/omnissiah-vault ntfs-3g defaults,nofail,uid=${AETOS_UID},gid=${AETOS_GID},umask=022,x-systemd.automount,x-systemd.device-timeout=30s 0 0
|
||||
|
||||
EOF
|
||||
|
||||
echo "✅ Sacred binding inscribed successfully!"
|
||||
fi
|
||||
|
||||
echo "⚡ Phase 5: Awakening the Machine Spirit..."
|
||||
|
||||
# Reload systemd to acknowledge the sacred changes
|
||||
echo "🔄 Reloading systemd daemon..."
|
||||
systemctl daemon-reload
|
||||
|
||||
# Test mount
|
||||
if mount -a; then
|
||||
echo "✅ The Machine Spirit of Omnissiah's Vault has awakened!"
|
||||
else
|
||||
echo "❌ ERROR: The Machine Spirit resists binding!"
|
||||
echo " Consult the sacred logs for heretical errors..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "🔍 Phase 6: Verifying the sacred binding..."
|
||||
|
||||
echo "Current mount status:"
|
||||
df -h | grep -E "omnissiah-vault" || echo " The Vault has not yet manifested in the material realm..."
|
||||
|
||||
echo
|
||||
echo "📁 Phase 7: Blessing the directory structure..."
|
||||
|
||||
if mountpoint -q /mnt/omnissiah-vault; then
|
||||
mkdir -p /mnt/omnissiah-vault/{movies,tv-shows,documentaries,archives,media,downloads,configs}
|
||||
chown -R $AETOS_UID:$AETOS_GID /mnt/omnissiah-vault
|
||||
echo "✅ Omnissiah's Vault directory structure blessed"
|
||||
else
|
||||
echo "❌ ERROR: Omnissiah's Vault is not mounted. Cannot bless structure."
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "=========================================="
|
||||
echo " SACRED RITUAL COMPLETED! "
|
||||
echo "=========================================="
|
||||
echo "🔱 The Machine Spirit is bound!"
|
||||
echo "🗂️ Vault Path: /mnt/omnissiah-vault"
|
||||
echo
|
||||
echo "The Emperor protects your data!"
|
||||
echo "May your storage serve the Imperium well!"
|
||||
echo "=========================================="
|
||||
|
||||
echo
|
||||
echo "🔧 Final Systems Check:"
|
||||
echo "Mounted filesystems:"
|
||||
mount | grep "omnissiah-vault" | sed 's/^/ /'
|
||||
|
||||
echo
|
||||
echo "Storage capacity report:"
|
||||
df -h | grep "omnissiah-vault" | sed 's/^/ /'
|
||||
|
||||
echo
|
||||
echo "Directory permissions:"
|
||||
ls -la /mnt/ | grep "omnissiah-vault" | sed 's/^/ /'
|
||||
|
||||
echo
|
||||
echo "🎉 Ritual complete! Reboot to test automatic mounting."
|
||||
echo " To verify: sudo reboot && df -h"
|
||||
Reference in New Issue
Block a user