diff --git a/src/usbinstall.sh b/src/usbinstall.sh index 99c97fb..040b14a 100755 --- a/src/usbinstall.sh +++ b/src/usbinstall.sh @@ -149,6 +149,10 @@ if [ -f "$2" ]; then # Check if is a file else errorAndExit "Error(Arg 2): \"$2\" isn't a regular file" 1 fi +# Check if Arg 2 is a gz file +if [ "${2##*.}" != "gz" ]; then + errorAndExit "Error(Arg 2): you must chose a cpio.gz file" 1 +fi # Check if Arg 3 is valid if [ -f "$3" ]; then # Check if is a file @@ -160,6 +164,10 @@ if [ -f "$3" ]; then # Check if is a file else errorAndExit "Error(Arg 3): \"$3\" isn't a regular file" 1 fi +# Check if Arg 3 is an iso file +if [ "${3##*.}" != "iso" ]; then + errorAndExit "Error(Arg 3): you must chose a iso file" 1 +fi #################################(INITIAL-CHECK)##################################### @@ -184,7 +192,7 @@ set_pbar 2 set_status "Formattazione della chiavetta in corso..." sudo fdisk $SELECT_USB < ./fdisk_template if [ "$?" != "0" ]; then - errorAndExit "Error: fdisk ended with error" + errorAndExit "Error: fdisk exit with error" fi set_pbar 5