Skip to content

Commit

Permalink
proxmox: scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Koushik Dutta authored and Koushik Dutta committed Sep 14, 2024
1 parent cf4f4b7 commit 1440b38
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
File renamed without changes.
32 changes: 32 additions & 0 deletions install/proxmox/setup-scrypted-nvr-volume.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

NVR_STORAGE=$1

# Check if NVR_STORAGE is set
if [ -z "$NVR_STORAGE" ]; then
echo "Error: NVR_STORAGE environment variable is not set."
exit 1
fi

# File to be modified
if [ -z "$VMID" ]
then
VMID="10443"
fi
FILE="/etc/pve/lxc/$VMID.conf"

# valdiate file exists
if [ ! -f "$FILE" ]; then
echo "Error: $FILE not found."
echo "If the Scrypted container id is not 10443, please set the VMID environment variable prior to running this script."
exit 1
fi

# Remove all lines containing "mnt/nvr"
sed -i '/mnt\/nvr/d' "$FILE"

# Append the new line with the substituted $NVR_STORAGE
echo "lxc.mount.entry: /mnt/pve/nvr-storage/mounts/$NVR_STORAGE mnt/nvr/large/$NVR_STORAGE none bind,optional,create=dir // [!code focus]" >> "$FILE"

echo "$FILE modified successfully. Starting Scrypted..."
pct start $VMID

0 comments on commit 1440b38

Please sign in to comment.