19 lines
354 B
Bash
19 lines
354 B
Bash
#!/bin/sh
|
|
|
|
ORIGIN=`pwd`
|
|
|
|
if [ "$(id -u)" -ne 0 ]; then
|
|
echo "Please run as root"
|
|
exit
|
|
fi
|
|
|
|
cd /etc/credentials
|
|
for file in *; do
|
|
[ ! -f "$file" ] && continue
|
|
echo "# mounting $file"
|
|
. ./$file
|
|
[ -d /mnt/$file ] || mkdir /mnt/$file
|
|
mount -t cifs //$domain/backup /mnt/$file -o credentials=/etc/credentials/$file
|
|
done
|
|
|
|
cd $ORIGIN
|