Ubuntu Pastebin

Paste from zetheroo at Thu, 29 Jun 2017 07:09:36 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
{
    echo "executing script bash"
    sleep 20
    
    declare -A mounted
    ok=0
    shares=(smb://server/share1 smb://server/share2 smb://server/share3)

    while [ "${#shares[@]}" != "$ok" ]; do
        for share in "${shares[@]}"; do
            if [ "${mounted["$share"]}" = 1 ]; then
                continue
            fi
            echo "mounting $share"

            if gvfs-mount "$share"; then
                echo "    ok"
                mounted["$share"]=1
                let ok++
            else
                echo "    failed"
            fi
        done
        sleep 1
    done

    echo "all done"

} > ~/mtmounts.log 2>&1
Download as text