WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: bcwipe - secure file system wiping tool - install script  (Read 1844 times)

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
bcwipe - secure file system wiping tool - install script
« on: November 26, 2011, 09:40:05 PM »
Code: [Select]
#!/bin/sh

. /etc/init.d/tc-functions

TMPDIR=/tmp/bcwipe123
VER="1.9-8"
SRC="BCWipe-"$VER".tar.gz"
MIRROR="http://www.jetico.com/linux"

DEPS="compiletc.tcz \
squashfs-tools-4.x"


if [ -f /etc/sysconfig/tcedir ]; then
 TCEDIR=`readlink /etc/sysconfig/tcedir`
elif [ -f /opt/.tce_dir ]; then
 TCEDIR=`cat /opt/.tce_dir`
fi


for I in `echo "$DEPS"`; do
   DEPNAME=`basename "$I" .tcz`
   if [ ! -f /usr/local/tce.installed/"$DEPNAME" ]; then
if [ -f "$TCEDIR"/"$I" ]; then
if su tc -c "tce-load -i "$I""; then
   echo "${YELLOW}"$I" loaded locally${NORMAL}"
else
   echo "${RED}"$I" failed to load, exiting..${NORMAL}"
   exit 1
fi
else
if su tc -c "tce-load -iw "$I""; then
   echo "${YELLOW}"$I" loaded from repo${NORMAL}"
else
   echo "${RED}"$I" failed to load, exiting..${NORMAL}"
   exit 1
fi
fi
   fi
done

[ -d "$TMPDIR" ] && rm -r "$TMPDIR"
mkdir -p "$TMPDIR"
cd "$TMPDIR"
wget "$MIRROR"/"$SRC"
tar xvf "$SRC"
cd bcwipe-"$VER"
./configure --prefix=/usr/local
make
make install DESTDIR="$TMPDIR"/pkg
cd "$TMPDIR"
mksquashfs pkg/ "$TCEDIR"/optional/bcwipe.tcz -noappend > /dev/null 2>&1
cd "$TCEDIR"
grep "bcwipe.tcz" "$TCEDIR"/onboot.lst > /dev/null 2>&1 || echo "bcwipe.tcz" >> "$TCEDIR"/onboot.lst     
cd "$TCEDIR"/optional
md5sum bcwipe.tcz > bcwipe.tcz.md5.txt
if [ ! -f /usr/local/tce.installed/bcwipe ]; then                                                                                         
  tce-load -i "$TCEDIR"/optional/bcwipe.tcz                                                                                                 
fi
echo "${BLUE}bcwipe.tcz${GREEN} is now installed and will be loaded onboot.${NORMAL}"

« Last Edit: December 21, 2011, 10:09:03 AM by Jason W »