| 152 | |
| 153 | == s3ql_endpoint_check == |
| 154 | |
| 155 | S3QL "Transport endpoint is not connected" check script |
| 156 | |
| 157 | {{{ |
| 158 | #!bash |
| 159 | #!/bin/bash |
| 160 | |
| 161 | # Check for errors like this with s3ql buckets: |
| 162 | # df |
| 163 | # df: ‘/media/s3ql/crin1’: Transport endpoint is not connected |
| 164 | |
| 165 | # check if a Transport endpoint is not connected |
| 166 | S3QL_DISCONNECTED_ENDPOINTS=$(df 2>&1 | grep "Transport endpoint is not connected" | awk '{ print $2 }' | tr -d '‘' | tr -d '’:') |
| 167 | if [[ "$S3QL_DISCONNECTED_ENDPOINTS" ]]; then |
| 168 | for s3qlfs in $S3QL_DISCONNECTED_ENDPOINTS; do |
| 169 | fusermount -u -z "${s3qlfs}" && \ |
| 170 | { echo "Success unmounting ${s3qlfs}" ; exit 0 ; } || \ |
| 171 | { echo "Problem unmounting ${s3qlfs}, consider using: killall -9 mount.s3ql" ; exit 1 ; } |
| 172 | done |
| 173 | fi |
| 174 | }}} |