attempting to add NAS drive connection as automount systemd service

This commit is contained in:
2026-07-23 06:11:33 -06:00
parent a3be54e03a
commit f85882f944
10 changed files with 112 additions and 2 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/bin/sh
set -xe
USERNAME=$(op read "op://Personal/Main NAS/username" 2>&1)
PASSWORD=$(op read "op://Personal/Main NAS/password" 2>&1)
if [ -z "$USERNAME" ] || [ -z "$PASSWORD" ]; then
echo "Failed to fetch credentials" >&2
exit 1
fi
CRED_DIR="$HOME/.nas"
mkdir -p "$CRED_DIR"
chmod 700 "$CRED_DIR"
cat >"$CRED_DIR/.smbcredentials" <<EOF
username=$USERNAME
password=$PASSWORD
EOF
chmod 600 "$CRED_DIR/.smbcredentials"