#!/bin/sh ORIGIN=`pwd` if [ "$(id -u)" -ne 0 ]; then echo "Please run as root" exit fi cd /etc/credentials for file in ./* do echo "# mounting $file" . $file mount -t cifs //$domain/backup /mnt/$file -o credentials=/etc/credentials/$file fi cd $ORIGIN