All pastes #759707 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-11-03 12:58 UTC
rendered paste body
#!/bin/bash
DIR=$1
PWD=$2
#echo $DIR
#echo $PWD

# Allow anything containing -DK-
if [[ "$DIR" =~ "[-_\(][dD][kK][-_\)]" ]]
then
    echo "Everything DK is allowed :) Thanks dude ..."
    exit 0
fi

# Don't check these directories :)
NOCHECK_TREES="/site/archive /site/0day /site/requests /site/speedtest"
for tree in $NOCHECK_TREES; do
    case $2 in
        ${tree}*)
            exit 0
        ;;
        *)
            ;;
    esac
done

if [[ "$PWD" =~ "/site/dvdr" ]]
then
    echo "The DVD-R section is not open yet. Try later ..."
    exit 2
fi

if [[ "$PWD" =~ "/site/tv" ]]
then
    if [[ "$DIR" =~ "[sS][aA][mM][pP][lL][eE]" ]]
    then
        exit 0
    fi

    if [[ ! "$DIR" =~ "720[pP].[hH][dD][tT][vV].[xX]264" ]]
    then
        echo "Only 720p.HDTV.x264 is allowed here."
        exit 2
    else
        exit 0
    fi
fi

# Cut off old crap
if [[ ! "$DIR" =~ "[2][0][0][7-9]" ]]
then
    echo "Only 2007, 2008 and 2009 allowed here"
    exit 2
fi

# Banned languages


# Banned sources
if [[ "$DIR" =~ "[-_\(][vV][iI][nN][yY][lL][-_\(]" ]]
then
  echo "Matched banned source: Vinyl"
  exit 2
elif [[ "$DIR" =~ "[-_\(][vV][lL][sS][-_\)]" ]]
then
  echo "Matched banned source: VLS"
  exit 2
elif [[ "$DIR" =~ "[-_\(][eE][pP][-_\)]" ]]
then
    echo "Matched banned source: EP"
    exit 2
elif [[ "$DIR" =~ "[[-_\(][cC][dD][eE][pP][-_\)]" ]]
then
    echo "Matched banned source: CDEP"
    exit 2
elif [[ "$DIR" =~ "[aA][uU][dD][iI][oO][bB][oO][oO][kK]" ]]
then
  echo "Matched banned source: Audiobook"
  exit 2
elif [[ "$DIR" =~ "[-_\(][wW][eE][bB][-_\)]" ]]
then
  echo "Matched banned source: Web"
  exit 2
elif [[ "$DIR" =~ "[-_\(][mM][aA][gG][-_\)]" ]]
then
  echo "Matched banned source: Mag"
  exit 2
elif [[ "$DIR" =~ "[-_\(][sS][aA][tT][-_\)]" ]]
then
  echo "Matched banned source: Sat"
  exit 2
elif [[ "$DIR" =~ "[-_\(][dD][aA][tT][-_\)]" ]]
then
  echo "Matched banned source: Dat"
  exit 2
elif [[ "$DIR" =~ "[-_\(][sS][bB][dD][-_\)]" ]]
then
  echo "Matched banned source: SBD"
  exit 2
elif [[ "$DIR" =~ "[-_\(][dD][vV][bB][sS][-_\)]" ]]
then
  echo "Matched banned source: DVBS"
  exit 2
elif [[ "$DIR" =~ "[-_\(][cC][aA][bB][lL][eE][-_\)]" ]]
then
  echo "Matched banned source: Cable"
  exit 2
elif [[ "$DIR" =~ "[-_\(][fF][mM][-_\)]" ]]
then
  echo "Matched banned source: FM"
  exit 2
elif [[ "$DIR" =~ "[-_\(][dD][aA][bB][-_\)]" ]]
then
  echo "Matched banned source: DAB"
  exit 2
elif [[ "$DIR" =~ "[-_\(][tT][aA][pP][eE][-_\)]" ]]
then
  echo "Matched banned source: Tape"
  exit 2
elif [[ "$DIR" =~ "[-_\(][lL][iI][nN][eE][-_\)]" ]]
then
  echo "Matched banned source: Line"
  exit 2
elif [[ "$DIR" =~ "[bB][oO][oO][tT][lL][eE][gG]" ]]
then
  echo "Matched banned source: Bootleg"
  exit 2
elif [[ "$DIR" =~ "[-_\(][lL][iI][vV][eE]" ]]
then
  echo "Matched banned source: Live"
  exit 2
fi

# test dirs
if [[ "$DIR" =~ "[_-\(][tT][eE][sS][tT][-_\)]" ]]
then
  echo "Please upload your test-directories in /speed-test"
  exit 2
fi

# if we are at this stage, just let the motherfucker at his directory
exit 0