#!/bin/bash # $Id$ # # Script to update the default NST password on a ISO image. If you run # this prior to burning the CD, you'll be able to have your own custom # password. usage() { cat < 30 )); then printf "\n***ERROR*** $PLEN is too long for password (at most 30 chars)\n" usage fi if [ ! -f "${ISO}" ]; then printf "\n***ERROR*** could not find ISO image file: ${ISO}\n" usage fi PASS="$(echo "$PASS" | tr\ 'Tg8WfiYPNrvlkeKZFUnHRpLA1m4O7d92aBJxwQs5bocyGjuCDhtzq6MSV3I0XE'\ 'IkUYuMVLOhPWnSKEXv2s0Fr4atdD3lqTeJy7poNC1xZRBbjGz96mAQwgcf5iH8')" CHECK="$(dd if="$ISO" skip=${OFS} bs=1 count=15 2>/dev/null)" if [ "$CHECK" != "NST_BOOT_PASSWD" ]; then printf "\n***ERROR*** appears to be incorrect ISO image did not find\n" printf "NST_BOOT_PASSWD string at offset ${OFS}.\n" exit 1 fi echo "Updating password line in ISO image at offset ${OFS}..." printf "NST_BOOT_PASSWD=%-32s" '"'${PASS}'"' | \ dd of="$ISO" seek=${OFS} bs=1 conv=notrunc 2>/dev/null echo "Done. Good luck."