<u>'''INSTALL'''</u>
<pre># INSTALL# App specific variablesexport WASNAM='pmagic';export WALNAM='Parted Magic';export WAPATH='/var/hda/web-apps/pmagic$HDA_APP_DIR/html';
# Constant variables--DO NOT CHANGE
export NBPATH='/var/lib/tftpboot';
export INTFC=`ifconfig | expand | cut -c1-8 | sort | uniq -u | awk -F: '{print $1;}' | grep -Fvx -e lo | grep -Fvx -e tun0`
export HDAIP=$(/sbin/ip -o -4 addr list $INTFC | awk '{print $4}' | cut -d/ -f1);
# Start of $WALNAM Installcat > html/install-$WASNAM.sh << EOF
#!/bin/bash
mkdir -p $NBPATH/$WASNAMHDA_APP_NAME;# Copy $WALNAM files to Netbootcp cd $WAPATH;cd ../unpack;cp live/$WASNAMvmlinuz live/initrd.img live/* filesystem.squashfs -d $NBPATH/$WASNAMHDA_APP_NAME;
# Update PXE Menu
if [ -f $NBPATH/pxelinux.cfg/default.bu ]; then
# Append app menu to default
if [ -d $NBPATH/menu ]; then
cp $WAPATH/$WASNAMHDA_APP_NAME.mnu $NBPATH/menu
cat $NBPATH/menu/*.mnu >> $NBPATH/pxelinux.cfg/default
else
mkdir $NBPATH/menu
cp $WAPATH/$WASNAMHDA_APP_NAME.mnu $NBPATH/menu
cat $NBPATH/menu/*.mnu >> $NBPATH/pxelinux.cfg/default
fi
# Copy submenu (if needed) to conf
if [ -d $NBPATH/conf ]; then
cp $WAPATH/$WASNAMHDA_APP_NAME.conf $NBPATH/conf
else
mkdir $NBPATH/conf
cp $WAPATH/$WASNAMHDA_APP_NAME.conf $NBPATH/conf
fi
cd $WAPATH;
rm -rf ../unpack;
echo "Installation complete.";
# End of $WALNAM Install
EOF
# Start of $WASNAM Uninstallcat > html/uninstall-$WASNAM.sh << EOF
#!/bin/bash
# Remove $WALNAMfilesrm -rf $NBPATH/$WASNAMHDA_APP_NAME;rm -rf $NBPATH/conf/$WASNAMHDA_APP_NAME.conf;rm -rf $NBPATH/menu/$WASNAMHDA_APP_NAME.mnu;
cp $NBPATH/pxelinux.cfg/default.bu $NBPATH/pxelinux.cfg/default;
if [ -f $NBPATH/menu/*.mnu ]; then
fi
echo "Uninstallation complete.";
# End of $WALNAM Uninstall
EOF
# This needs to be changed to match the app. This can be a single menu or link to a sub menu
cat > html/$WASNAMHDA_APP_NAME.mnu << EOFLABEL Parted Magic$HDA_APP_NAME MENU LABEL Parted Magic$HDA_APP_NAME
kernel menu.c32
append conf/pmagic$HDA_APP_NAME.conf
EOF
# This is specific to the app and may not be needed. It generates a sub menu
cat > html/$WASNAMHDA_APP_NAME.conf .old << EOFMENU TITLE Parted Magic$HDA_APP_NAMELABEL Parted Magic$HDA_APP_NAME MENU LABEL Parted MagicNormal kernel pmagic$HDA_APP_NAME/bzImagevmlinuz append initrd=pmagic$HDA_APP_NAME/initramfs load_ramdiskinitrd.img boot=live union=1 prompt_ramdiskaufs noswap noprompt vga=0 rw sleep788 fetch=10tftp://$HDA_IP/$HDA_APP_NAME/filesystem.squashfs live-config LABEL $HDA_APP_NAME MENU LABEL Failsafe kernel $HDA_APP_NAME/vmlinuz append initrd=$HDA_APP_NAME/initrd.img boot=live union=aufs noswap noprompt vga=normal nomodeset nosplash ip=$HDA_IPfetch=tftp://$HDA_IP/$HDA_APP_NAME/filesystem.squashfs live-configEOF cat > html/$HDA_APP_NAME.conf << EOF MENU TITLE $HDA_APP_NAMELABEL Parted Magic (FAILSAFE)$HDA_APP_NAME MENU LABEL Parted Magic (FAILSAFE)Easy kernel pmagic$HDA_APP_NAME/bzImagevmlinuz append initrd=pmagic$HDA_APP_NAME/initrd.img boot=live union=aufs noswap noprompt vga=normal fetch=tftp://$HDA_IP/$HDA_APP_NAME/filesystem.squashfs ocs_prerun="mount -t cifs -v //$HDA_IP/Drivebackups /home/partimag -o user=$HDA_1ST_ADMIN" ocs_live_run="ocs-sr -gs -cs -r -j2 -k -rm-win-swap-hib -fsck-src-part -z1p -um beginner ask_user ask_user" ip=dhcp live-configLABEL $HDA_APP_NAME MENU LABEL Generic kernel $HDA_APP_NAME/vmlinuz append initrd=$HDA_APP_NAME/initrd.img boot=live union=aufs noswap noprompt vga=788 nomodeset nosplash vga=normal ocs_lang="" fetch=tftp://$HDA_IP/$HDA_APP_NAME/filesystem.squashfs live-configLABEL $HDA_APP_NAME MENU LABEL Expert kernel $HDA_APP_NAME/vmlinuz append initrd=$HDA_APP_NAME/initrd.img boot=live union=aufs noswap noprompt vga=normal fetch=tftp://$HDA_IP/$HDA_APP_NAME/filesystem.squashfs ocs_prerun="mount -t cifs -v //$HDA_IP/Drivebackups /home/initramfs load_ramdiskpartimag -o user=1 prompt_ramdisk$HDA_1ST_ADMIN" ocs_live_run=0 rw sleep"ocs-sr -gs -cs -r -j2 -k -z1p -um expert ask_user ask_user" ip=10 livemedia dhcp live-config
EOF
<body bgcolor = "#ffffcc" text = "#000000">
<center>
<img src="http://wiki.amahi.org/images/6e/60e0/PartedmagicClonezilla-logo.png"></a>
</center>
<h1>Parted Magic Clonezilla Live Installed!</h1>
<p>The Parted Magic OS employs core programs of GParted and Parted to handle partitioning tasks with easeClonezilla, while featuring other useful based on <a href="http://programsdrbl.htmlsf.net" mce_hreftarget="_">DRBL</a>, <a href="http:/programs/www.htmlpartimage.org" target="_blank_">programsPartition Image</a> (e, <a href="http://www.glinux-ntfs. Clonezillaorg/" target="_">ntfsclone</a>, Partimage, TestDisk, Truecrypt, G4L, SuperGrubDisk, ddrescue, etc...) and an excellent set of <a href="http:/documentation/partclone.htmlorg" target="_" mce_href>partclone</a>, and <a href="http:/documentation/udpcast.linux.htmllu/" target="_blank_">documentationudpcast</a> , allows you to benefit the userdo bare metal backup and recovery. An extensive collection Two types of file system tools Clonezilla are also includedavailable, as Parted Magic supports the following<a href="http: ext2, ext3, ext4, fat16, fat32, hfs, hfs+, jfs, linux//drbl.sf.net/clonezilla-live/" target="_">Clonezilla live</a> and <a href="http://drbl.sf.net/clonezilla-server-swap, ntfs, reiserfs, reiser4, edition/" target="_">Clonezilla SE (server edition)</a>. Clonezilla live is suitable for single machine backup and xfsrestore.</p>
<p><b>NOTE:</b> This application is a PXE network bootable OS which cannot be accessed via a web browser. Uncheck <b>List in dashboard</b> option to remove link from dashboard.</p>
EOF
chmod 755 html/install-$WASNAM.sh html/uninstall-$WASNAM.sh;
mkdir elevated;
cd elevated
cp $WAPATH/install-$WASNAM.sh .;sudo ./install-$WASNAM.sh;
cd ..;
rm -rf elevated;</pre>