#!/bin/bash

# mount iso image file
isolist=$(tersql -sql "select * from share where type='ISO'")
for row in $(echo $isolist|jq -c -r .[]); do
    echo $row
    mntfile=$(echo $row | jq -r .extend)
    mntpath=$(echo $row | jq -r .mntpath)
    mount $mntfile $mntpath
    if [ $? -eq 0 ]; then
        echo mount $mntfile to $mntpath file success
    else
        echo mount $mntfile to $mntpath file failed
    fi
done
