Skip to content

Instantly share code, notes, and snippets.

@sebastian13
Last active April 7, 2024 16:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebastian13/81f4b6124e8d7d0551c1b3e2ffb2c609 to your computer and use it in GitHub Desktop.
Save sebastian13/81f4b6124e8d7d0551c1b3e2ffb2c609 to your computer and use it in GitHub Desktop.
List any encrypted but not mounted volume on a Synology NAS
#!/bin/bash
#
# List any encrypted but not mounted volume on a Synology NAS
#
# Author: Sebastian Plocek
# https://gist.github.com/sebastian13/81f4b6124e8d7d0551c1b3e2ffb2c609
#
dsm="https://<your-nas-domain>:<your-dsm-port>"
set -e
enc_shares=$(/usr/syno/sbin/synoshare --enum ENC)
ignore="Share Enum Arguments:\|Listed:"
if [[ $(echo "$enc_shares" | grep -c -v "$ignore") -gt 0 ]]; then
echo "The following shares are encrypted and currently not mounted."
echo
echo "$enc_shares" | grep -v "$ignore"
echo
echo "Please go to $dsm to mount it!"
echo
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment