Smart iSCSI Mounter v0.97.1
- Improved handling of input args.
This commit is contained in:
+20
-12
@@ -24,7 +24,6 @@ show_usage (){
|
||||
echo "Additional Options:"
|
||||
echo "'-s (--status)'"
|
||||
echo "'-r (--release)'"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
report_status (){
|
||||
@@ -100,41 +99,50 @@ check_admin (){
|
||||
}
|
||||
|
||||
# Process input parameters
|
||||
while (( "$#" )); do
|
||||
case "$2" in
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
-f|--force)
|
||||
_FLAG_FORCE=1
|
||||
;;
|
||||
esac
|
||||
case "$1" in
|
||||
_FLAG_FORCE=1
|
||||
shift
|
||||
;;
|
||||
-m|--mount)
|
||||
check_admin
|
||||
read_iscsi_con
|
||||
mount_func
|
||||
shift
|
||||
;;
|
||||
-u|--umount)
|
||||
check_admin
|
||||
read_iscsi_con
|
||||
umount_func
|
||||
shift
|
||||
;;
|
||||
-s|--status)
|
||||
echo "[Showing status of mount-point]"
|
||||
check_admin
|
||||
read_iscsi_con
|
||||
report_status
|
||||
shift
|
||||
;;
|
||||
-r|--release)
|
||||
echo "Smart iSCSI Mounter v0.97"
|
||||
echo "Smart iSCSI Mounter v0.97.1"
|
||||
shift
|
||||
;;
|
||||
-*)
|
||||
-h|--help)
|
||||
show_usage
|
||||
;;
|
||||
shift
|
||||
;;
|
||||
-q|--quiet)
|
||||
echo "Quiet"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
exit 0;
|
||||
done
|
||||
done
|
||||
|
||||
# Show usage if no parameters have been passed
|
||||
if [[ $# -eq 0 ]]
|
||||
then
|
||||
show_usage
|
||||
fi
|
||||
|
||||
exit 0;
|
||||
Reference in New Issue
Block a user