#!/bin/bash
# 
# Extracts an ISO using xorriso 
# 
# Gabriel Marques 
# snortt@gmail.com
# Thu 10 Mar 2022 04:49:34 PM EST

me="$(id -u)"
if [ "$me" -ne "0" ]; then
    echo "I need to be run as root"
    exit
fi

if [ ! -x $(which xorriso) ]; then
    echo "xorriso not found!"
    echo "please install it."
    exit
fi

if [ "$#" -ne "1" ]; then
    echo "Usage: $(basename $0) <ISO> "
    exit 201 
fi 

xorriso -osirrox on -indev $1 -extract / "${1/.iso/}-fmw"

