install.sh (730B)
1 #!/usr/bin/env sh 2 3 set -e 4 5 NAME="dotfm" 6 CURRDIR=$(pwd) 7 DESTBIN=/usr/local/bin 8 DESTMAN=/usr/local/man/man1 9 10 mkdir -p $DESTBIN $DESTMAN 11 12 if [ "$1" = "-h" ]; then 13 echo "usage: ./install.sh [-h|-l|-u]" 14 echo "" 15 echo "options:" 16 echo " -h print this message" 17 echo " -l link the install files from source (not copy)" 18 echo " -u uninstall all install files" 19 echo "" 20 elif [ "$1" = "-l" ]; then 21 ln -iv "$CURRDIR/src/$NAME.py" "$DESTBIN/$NAME" 22 ln -iv "$CURRDIR/src/$NAME.1" "$DESTMAN" 23 elif [ "$1" = "-u" ]; then 24 rm -i "$DESTBIN/$NAME" 25 rm -i "$DESTMAN/$NAME.1" 26 else 27 cp -v "$CURRDIR/src/$NAME.py" "$DESTBIN/$NAME" 28 chmod +x "$DESTBIN/$NAME" 29 chown root:wheel "$DESTBIN/$NAME" 30 cp -v "$CURRDIR/src/$NAME.1" "$DESTMAN" 31 fi