All pastes #394310 Raw Edit

Stuff

public shellscript v1 · immutable
·published 2007-03-14 05:50 UTC
rendered paste body
#!/bin/sh#Created by TheX1lefunction errcsk {if [ "$?" != "0" ]; then	echo $ERRMSG	exitelse	echo $SUCMSGfi}clearecho "This simple script is just for installing bt2, it assumes you have created and formatted your partitions all ready. Version BETA 2" #Handles input of boot and root partitionsecho "Your Source for BT files EX. /"read SOURCEecho "Your boot partition EX. hda1" read BOOTecho "Your root partition EX. hda3"read ROOTclearif [ -z"$SOURCE" ]; then	echo "Please set a source"	exitelse	if [ -z"$BOOT" ]; then		echo "Please set a boot Destination"		exit	else		if [ -z"$root" ]; then			echo "Please set a root Destination"			exit		fi	fifimkdir -p /tmp/backtrack/boot#determines if you are using mutiple partitons or notif [ "$BOOT" == "$ROOT" ]; then	echo -e "This is not the best recomended install method"	echo "Mounting Drive"	ERRMSG=$(echo -e "\033[31m Mounting failed check your partitions")	SUCMSG=$(echo "Drive mounted sucessfully")	mount /dev/$ROOT /tmp/backtrack	errcskelse	echo "Mounting Drives"	mount /dev/$BOOT /tmp/backtrack/boot	mount /dev/$ROOT /tmp/backtrack	ERRMSG=$(echo -e "\033[31m Mounting failed check your partitions")	SUCMSG=$(echo "Drives mounted sucessfully")	mount /dev/$ROOT /tmp/backtrack	errcskfi#copies over the filescp --preserve -R -v $SOURCE/{bin,dev,home,pentest,root,usr,etc,lib,opt,sbin,var} /tmp/backtrackERRMSG=$(echo -e "\033[31m Files did not copy correctly there were some errors")SUCMSG=$(echo "Backtrack files copied sucessfully")errcskmkdir /tmp/backtrack/{mnt,proc,sys,tmp}ERRMSG=$(echo -e "\033[31m mnt,proc,sys,tmp failed to be made there was an error")SUCMSG=$(echo "mnt,proc,sys,tmp created sucessfully")errcskcp "$SOURCE"/boot/vmlinuz /tmp/backtrack/bootERRMSG=$(echo -e "\033[31m Kernel did not copy correctly there was an error")SUCMSG=$(echo "Kernel copied sucessfully")errcskread -p "Backtrack copied to hard drive successfully press the ANY KEY to continue"clearecho "mounting dev and proc"mount --bind /dev/ /tmp/backtrack/dev/ && mount -t proc proc /tmp/backtrack/proc/ERRMSG=$(echo -e "\033[31m dev or proc failed to mount there was an error")SUCMSG=$(echo "dev and proc mounted sucessfully")errcskecho "your next step is to chroot into your new install IE [chroot /tmp/backtrack/ /bin/bash], then edit /etc/lilo.conf and run lilo -v . Thats it your installed"