Skip to content

Commit 5aefe28

Browse files
committed
mount-remotes: initial commit
1 parent 87863aa commit 5aefe28

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

mount-remotes.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
# -*- coding: UTF-8 -*-
3+
set -eu
4+
pass=${1}
5+
user=${2:-$USER}
6+
7+
8+
remotes=("srv-its-file02/SW_Develop" "srv-its-file02/SW_Released" "srv-krs-file01/SW_Develop")
9+
for r in ${remotes[@]}; do
10+
if [[ ! -d /mnt/${r} ]]; then
11+
echo [!] could not mount ${r}, missing mountpoint under /mnt
12+
continue
13+
fi
14+
if mount | grep ${r} 2>&1>/dev/null; then
15+
echo [+] ${r} already mounted
16+
continue
17+
fi
18+
sudo mount -t cifs -o username=${user},password="${pass}",workgroup=TMT //${r} /mnt/${r}
19+
done

0 commit comments

Comments
 (0)