common.sh 406 Bytes
Newer Older
1 2 3 4 5
#!/bin/bash

set -x

# You may tune this section
6
SOFT_DIR="/data/software"
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
PREWORK_DIR=${SOFT_DIR}/sources
PREINSTALL_DIR=${SOFT_DIR}/install
PREMODULE_DIR=${SOFT_DIR}/modules
###

mkdir -p $PREWORK_DIR
mkdir -p $PREINSTALL_DIR
mkdir -p $PREMODULE_DIR

clean_dir()
{
if [[ -d $1 ]]
then
  rm -rf $1
else
  echo "WARNING: $1 does not exist"
fi
}

clean_all()
{
  clean_dir $SRC_DIR
  clean_dir $BUILD_DIR
}