Skip to content

Instantly share code, notes, and snippets.

View Brunnocampos1's full-sized avatar

Brunno M. Campos Brunnocampos1

View GitHub Profile
@faun
faun / smb_fs_automount.sh
Last active July 8, 2020 10:50
Script to mount remote SMB volume using password stored in Mac OS keychain without needing admin or sudo priveliges
#!/usr/bin/env bash
# Fetch the password from the keychain if it exists
PASSWORD_ENTERED=false
ACCOUNT_NAME='login'
SERVICE_NAME='mount_volume'
PASSWORD=$(
security 2> /dev/null \
find-generic-password -w \
-a $ACCOUNT_NAME \