Skip to content

Commit b4f2974

Browse files
authored
fix: Simplify secret
1 parent 3ccbc1f commit b4f2974

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

samba.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ set -Eeuo pipefail
44
# Set variables for group and share directory
55
group="smb"
66
share="/storage"
7+
secret="/run/secrets/pass"
78

89
# Create shared directory
910
mkdir -p "$share" || { echo "Failed to create directory $share"; exit 1; }
@@ -71,8 +72,8 @@ else
7172
fi
7273

7374
# Check if the secret file exists and if its size is greater than zero
74-
if [ -s "$PASS_SECRETFILE" ]; then
75-
PASS=$(cat "$PASS_SECRETFILE")
75+
if [ -s "$secret" ]; then
76+
PASS=$(cat "$secret")
7677
fi
7778

7879
# Change Samba password

0 commit comments

Comments
 (0)