Skip to content

Instantly share code, notes, and snippets.

@icheko
Last active April 5, 2017 18:33
Show Gist options
  • Select an option

  • Save icheko/d5dcd0d7e70f8c559813 to your computer and use it in GitHub Desktop.

Select an option

Save icheko/d5dcd0d7e70f8c559813 to your computer and use it in GitHub Desktop.

Revisions

  1. icheko revised this gist Mar 17, 2015. 1 changed file with 0 additions and 0 deletions.
    Empty file modified check-s3fs-mount.sh
    100644 → 100755
    Empty file.
  2. icheko created this gist Sep 3, 2014.
    35 changes: 35 additions & 0 deletions check-s3fs-mount.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    #!/bin/sh

    MNT_PATH=$1

    if [ -z "$MNT_PATH" ]
    then
    echo "MNT_PATH is not set"
    exit
    fi

    DF_OUTPUT=$((df -h | grep $MNT_PATH) 2>&1)
    if [[ "$DF_OUTPUT" != *"endpoint is not connected"* ]]
    then
    exit;
    fi
    echo "NFS is unmounted"
    echo "================"
    echo "lazy unmounting $1..."
    # lazy unmount
    umount -l $1
    echo "sleep...15"
    # wait
    sleep 15
    echo "mount fstab"
    # mount
    mount -a
    echo "done!"
    echo "================"
    df -h