Skip to content

Instantly share code, notes, and snippets.

Created January 18, 2013 01:10
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Bash script to install XAR. Run as root and takes one command line argument where you want the xar executable to exist.
if [ "`whoami`" != "root" ]; then
printf "Please run this script as root or using sudo\n"
exit 0
printf "Setting up XAR\n"
cp $XAR.tar.gz $LIB_DIR/
tar -xzvf $XAR.tar.gz
rm $XAR.tar.gz
cd $XAR
sudo make install
printf "******************************\n"
printf "xar setup!\n"
printf "******************************\n"
Copy link

almost commented Jan 31, 2013

It sudo's the make install so shouldn't require root for the whole script. Suggest removing lines 2-5

Copy link

This is extremely bad advice. Please never run any code as root or sudo unless it's your code. You should never install any software to system global paths. Use local builds.

Copy link

The inconsistent whtitespace characters on lines 3/4 are driving me crazy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment