coastie wrote:
i would like to take this script that comes with slax and tweak it to ask me which directory i would like to make an iso.
crouse...here is a place that i am attempting to learn about bash

Code:
#!/bin/bash
# ---------------------------------------------------
# Script to create bootable ISO in Linux
# usage: make_iso.sh [ /tmp/slax.iso ]
# author: Tomas M. <http://www.linux-live.org>
# ---------------------------------------------------
if [ "$1" = "--help" -o "$1" = "-h" ]; then
echo "This script will create bootable ISO from files in curent directory."
echo "Current directory must be writable."
echo "example: $0 /mnt/hda5/slax.iso"
exit
fi
CDLABEL="SLAX"
ISONAME="$1"
if [ "$ISONAME" = "" ]; then
SUGGEST="../`basename \`pwd\``.iso"
echo -ne "Target ISO file name [ Hit enter for $SUGGEST ]: "
read ISONAME
if [ "$ISONAME" = "" ]; then ISONAME="$SUGGEST"; fi
fi
# isolinux.bin is changed during the ISO creation,
# so we need to restore it from backup.
cp -f boot/isolinux.bi_ boot/isolinux.bin
if [ $? -ne 0 ]; then
echo "Can't recreate isolinux.bin, make sure your current directory is writable!"
exit 1
fi
mkisofs -o "$ISONAME" -v -J -R -D -A "$CDLABEL" -V "$CDLABEL" \
-no-emul-boot -boot-info-table -boot-load-size 4 \
-b boot/isolinux.bin -c boot/isolinux.boot .
i would do something more like this:
Code:
#!/bin/bash
# ---------------------------------------------------
# Script to create bootable ISO in Linux
# usage: make_iso.sh [ /tmp/slax.iso ]
# author: Tomas M. <http://www.linux-live.org>
# ---------------------------------------------------
if [ "$1" = "--help" -o "$1" = "-h" ]; then
echo "This script will create bootable ISO from files in curent directory."
echo "Current directory must be writable."
echo "example: $0 /mnt/hda5/slax.iso"
exit
fi
CDLABEL="SLAX"
ISONAME="$1"
echo "Please enter the directory where you would like the iso created"
read -p ": " to_dir
if [ "${to_dir:${#to_dir}-1}" = "/" ]
then
to_dir="${to_dir:0:${#to_dir}-1}"
fi
if [ ! -w "${to_dir}" ]
then
echo "That directory either doesn't exist, or is not writtable!"
exit
fi
if [ "$ISONAME" = "" ]; then
SUGGEST="../`basename \`pwd\``.iso"
echo -ne "Target ISO file name [ Hit enter for $SUGGEST ]: "
read ISONAME
if [ "$ISONAME" = "" ]; then ISONAME="$SUGGEST"; fi
fi
# isolinux.bin is changed during the ISO creation,
# so we need to restore it from backup.
cp -f boot/isolinux.bi_ "${to_dir}"/boot/isolinux.bin
if [ $? -ne 0 ]; then
echo "Can't recreate isolinux.bin, make sure your current directory is writable!"
exit 1
fi
mkisofs -o "$ISONAME" -v -J -R -D -A "$CDLABEL" -V "$CDLABEL" \
-no-emul-boot -boot-info-table -boot-load-size 4 \
-b boot/isolinux.bin -c boot/isolinux.boot "${to_dir}"
let me know if that works... can't say i have ever tried doing what you are talking about, but it seems it would work this way
