Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.