10.09.2016 Views

Hacking_and_Penetration_Testing_with_Low_Power_Devices

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

84 CHAPTER 4 Filling the toolbox<br />

else<br />

echo "configure failed for $fname"<br />

fi<br />

fi<br />

elif [ -e "setup.py" ] ; then<br />

# install the Python module<br />

'python setup.py install'<br />

else<br />

echo "Don't know how to build $fname"<br />

fi<br />

}<br />

# install from a source tarball<br />

install_tarball() {<br />

echo "Installing $fname tarball"<br />

cd /tmp<br />

# check the file extension<br />

extension¼$(echo ${fname} j tr "." "\n" j tail -1)<br />

if [ "$extension" ¼¼ "tar" ] ; then<br />

tar xf $fname<br />

else<br />

tar xaf $fname<br />

fi<br />

# strip off the extension<br />

bname¼$(echo $fname j sed 's/\.[^\.]*$//')<br />

cd $bname<br />

build_from_current_directory<br />

}<br />

#install after git clone<br />

install_git() {<br />

echo "Installing $fname from git repositories"<br />

cd /tmp<br />

bname¼$(echo $fname j sed 's/\.[^\.]*$//')<br />

cd $bname<br />

build_from_current_directory<br />

}<br />

#install after svn checkout<br />

install_svn() {<br />

echo "Installing $fname from svn repositories"<br />

cd /tmp/${fname}<br />

build_from_current_directory<br />

}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!