Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I usually use the mamp server on my Mac, but yesterday I ran this script.

#!/bin/bash

WWW_BASE='/Library/WebServer/Documents'
TARGET="$WWW_BASE"

expand_dir () {
  pushd "$1" >/dev/null
  DIR="`pwd`"
  popd >/dev/null
}

expand_dir `dirname $0`

clear

if [ -e "$WWW_BASE"/orbit ]; then
    echo 'Nothing to be done - linked already.'
else
    echo "Going to add link in $TARGET - 'sudo' may ask you for your password."

    ln -s "$DIR"/server/www/orbit $TARGET

    if [ $? -eq 0 ]; then
        echo 'Done.'
    else
        echo 'Failed (not an admin user or failed to authenticate).'
    fi
fi

echo
read -n 1 -s -p 'Press any key to continue...'
echo

How to undo this script I cant run my default server and all my aliases does not work any more?

share|improve this question
up vote 1 down vote accepted

This script could only create symbolic link /Library/WebServer/Documents/orbit which points to $DIR/server/www/orbit where $DIR (expand_dir function populates this variable) is a directory location of a script at the time of execution. By removing said link named /Library/WebServer/Documents/orbit you should undo the effects of the script.

share|improve this answer
    
thank you :) have to learn bash – Fincha Apr 3 '12 at 14:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .