mirror of
https://github.com/Matir/skel.git
synced 2026-05-25 21:19:09 -07:00
install_tool fixes.
This commit is contained in:
@@ -19,6 +19,9 @@ while getopts -- "-:" a ; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
shift $(($OPTIND-1))
|
||||||
|
echo $*
|
||||||
|
|
||||||
if [ $# -ne 1 ] ; then
|
if [ $# -ne 1 ] ; then
|
||||||
echo "Usage: ${0} <tool>" >/dev/stderr
|
echo "Usage: ${0} <tool>" >/dev/stderr
|
||||||
exit 1
|
exit 1
|
||||||
@@ -27,8 +30,10 @@ TOOL=${1}
|
|||||||
|
|
||||||
function install_pkgs {
|
function install_pkgs {
|
||||||
if [ `id -u` -ne "0" ] ; then
|
if [ `id -u` -ne "0" ] ; then
|
||||||
|
sudo apt-get -y install $* || (
|
||||||
echo "Unable to install packages, please ensure these are installed." >/dev/stderr
|
echo "Unable to install packages, please ensure these are installed." >/dev/stderr
|
||||||
echo $*
|
echo $*
|
||||||
|
false )
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
apt-get -y install $*
|
apt-get -y install $*
|
||||||
@@ -45,26 +50,25 @@ if [ -d ${DESTDIR} ] ; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p ${DESTDIR}
|
|
||||||
|
|
||||||
case ${TOOL} in
|
case ${TOOL} in
|
||||||
john)
|
john)
|
||||||
install_pkgs libssl-dev git build-essential yasm libgmp-dev libpcap-dev \
|
install_pkgs libssl-dev git build-essential yasm libgmp-dev libpcap-dev \
|
||||||
pkg-config libbz2-dev libopenmpi-dev openmpi-bin libnss-dev \
|
pkg-config libbz2-dev libopenmpi-dev openmpi-bin libnss3-dev \
|
||||||
libkrb5-dev libgmp-dev
|
libkrb5-dev libgmp-dev
|
||||||
jtemp=`mktemp -d`
|
jtemp=`mktemp -d`
|
||||||
git clone https://github.com/magnumripper/JohnTheRipper.git ${jtemp}/john
|
git clone https://github.com/magnumripper/JohnTheRipper.git ${jtemp}/john
|
||||||
cd ${jtemp}/john/src
|
cd ${jtemp}/john/src
|
||||||
./configure && make -sj2
|
./configure && make -sj2
|
||||||
|
mkdir -p ${DESTDIR}
|
||||||
cp -r ${jtemp}/john/run/* ${DESTDIR}
|
cp -r ${jtemp}/john/run/* ${DESTDIR}
|
||||||
rm -rf ${jtemp}
|
rm -rf ${jtemp}
|
||||||
# Persistent files
|
# Persistent files
|
||||||
mkdir -p ${HOME}/.john
|
mkdir -p ${HOME}/.john
|
||||||
|
touch ${HOME}/.john/john.pot
|
||||||
ln -sf ${HOME}/.john/* ${DESTDIR}
|
ln -sf ${HOME}/.john/* ${DESTDIR}
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown tool: ${TOOL}" >/dev/stderr
|
echo "Unknown tool: ${TOOL}" >/dev/stderr
|
||||||
rmdir ${DESTDIR}
|
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user