Skip to content

Instantly share code, notes, and snippets.

View mm-parthy's full-sized avatar

Parthy mm-parthy

View GitHub Profile
@mm-parthy
mm-parthy / bind-backup.sh
Created September 14, 2021 13:54 — forked from upsuper/bind-backup.sh
Script to automatically bind and unbind external USB drive on Synology NAS
#!/bin/bash
SERIAL="00000000"
echo "Looking for device with serial $SERIAL..."
for d in /sys/bus/usb/devices/*-*; do
if [[ -f "$d/serial" ]]; then
serial=$(<"$d/serial")
if [[ "$serial" = "$SERIAL" ]]; then
device="$(basename $d)"