Initial commit: qBittorrent & SMB AI Video Performer Sorter with in-browser streaming preview, Intellisense & SQLite persistence
This commit is contained in:
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Exit immediately if a command exits with a non-zero status
|
||||
set -e
|
||||
|
||||
SHARE="//truenas.local/isolation"
|
||||
MOUNT_POINT="/mnt/isolation"
|
||||
USERNAME="home"
|
||||
PASSWORD="kifer"
|
||||
|
||||
# Ensure cifs-utils is installed (required for mounting SMB shares)
|
||||
if ! dpkg -s cifs-utils >/dev/null 2>&1; then
|
||||
echo "Installing required package 'cifs-utils'..."
|
||||
sudo apt-get update && sudo apt-get install -y cifs-utils
|
||||
fi
|
||||
|
||||
# Create target mount directory if it doesn't exist
|
||||
if [ ! -d "$MOUNT_POINT" ]; then
|
||||
echo "Creating mount directory $MOUNT_POINT..."
|
||||
sudo mkdir -p "$MOUNT_POINT"
|
||||
fi
|
||||
|
||||
# Check if already mounted
|
||||
if mountpoint -q "$MOUNT_POINT"; then
|
||||
echo "Directory is already mounted. Unmounting first..."
|
||||
sudo umount "$MOUNT_POINT"
|
||||
fi
|
||||
|
||||
echo "Mounting $SHARE to $MOUNT_POINT..."
|
||||
# Mount temporarily. Using uid/gid configuration allows your local user to read/write to the share.
|
||||
# We fetch the current user's UID and GID dynamically.
|
||||
CURRENT_UID=$(id -u)
|
||||
CURRENT_GID=$(id -g)
|
||||
|
||||
sudo mount -t cifs "$SHARE" "$MOUNT_POINT" \
|
||||
-o username="$USERNAME",password="$PASSWORD",uid="$CURRENT_UID",gid="$CURRENT_GID",iocharset=utf8
|
||||
|
||||
echo "Successfully mounted $SHARE to $MOUNT_POINT."
|
||||
echo "Note: This mount is temporary and will automatically unmount upon reboot."
|
||||
Reference in New Issue
Block a user