head 1.1; access; symbols; locks georg:1.1; strict; comment @# @; 1.1 date 2003.04.22.14.07.17; author georg; state Exp; branches; next ; desc @@ 1.1 log @Initial revision @ text @#!/usr/bin/env bash sundir="/home/sunpendulum" mfsdir="${sundir}/mfs" flpdir="${sundir}/flp" eye=$1 prompt=$2 if [ x$USER != xroot ] then echo "be root" exit fi eyedir=${sundir}/eyes/${eye} if [ x${eye} = "x" ] then echo "floppy eyename [prompt]" exit 1 fi function pr { if [ x${prompt} != "x" ] then echo $1 read fi } function sset { if [ x${prompt} != "x" ] then set $1 fi } function abort { echo "$_ failed .. it is senseless to continue - exiting." exit } # create a mounted mfsroot on ${mfsdir} # ------------------------------------- echo -n "creating a mounted mfsroot on ${mfsdir} ... " cd ${sundir}/images || abort sset -x [ -f mfsroot.gz ] && gunzip mfsroot.gz vnconfig -c vn0 mfsroot || abort mount /dev/vn0c ${mfsdir} || abort sset +x echo "Done" pr "Mfsroot is unzipped an mounted, next comes file copy" # populate with individual files # ------------------------------ echo -n "populating with individual files ... " # this is for the harddisk sset -x cp -R -p -f ${eyedir}/fs/* ${mfsdir}/sun/ || abort # this is for the mfsroot fs cp -R -p -f ${eyedir}/cf/* ${mfsdir}/ || abort echo "Done" sset +x pr "Files are copied, next comes unmount and gzip" # umount mfsroot # -------------- echo -n "umount mfsroot ... " sset -x umount -f ${mfsdir} || abort vnconfig -u vn0 || abort gzip -9 mfsroot || abort sset +x echo "Done" pr "Unmount an zipping Done, next comes copy to floppy" # copy to floppy # -------------- echo -n "copy to floppy ... " sset -x vnconfig -c vn0 mfsroot.flp || abort mount /dev/vn0c ${flpdir} || abort cp mfsroot.gz ${flpdir}/ || abort umount ${flpdir} || abort vnconfig -u vn0 || abort cp mfsroot.flp ${eyedir}/flp/ || abort sset +x echo "Done" ls -l ${eyedir}/flp/ || abort echo pr "Floppy Image Done, next comes atesi.zip" # create atesi email # ------------------ echo -n "creating atesi email ... " cd ${eyedir} || abort dir=`basename ${eyedir}` echo $dir [ -d atesi ] || mkdir atesi rm -rf atesi/* sset -x ln ../../rawrite.exe atesi/ || abort ln ../../kern.flp atesi/ || abort ln flp/mfsroot.flp atesi/ || abort atesi="atesi-${dir}.zip" rm -rf $atesi zip -9r $atesi atesi/ || abort sset +x echo "Done" @