#!/usr/bin/perl
####################################################################
# Wipeout! Version 1.0 #
# Program to remove all previously created Links data directories #
####################################################################
# Written by Mark Badolato, CyberNox Technologies, Inc. #
# Last Modified May 25, 1998 #
####################################################################
# Copyright 1998, CyberNox Technologies, Inc. All Rights Reserved #
# Questions, comments, suggestions, or bugs may be emailed to: #
# #
# scripts@cybernox.com #
####################################################################
# WARNING AND DISCLAIMER #
# ---------------------- #
# #
# USE AT YOUR OWN RISK! Neither CyberNox Technologies, Inc., nor #
# Mark Badolato will be held responsible for any loss of files, #
# data, or any other losses or errors that may occur. By using #
# this program, you agree to indemnify CyberNox Technologies, Inc. #
# and Mark Badolato from any liability. #
# #
# Misuse of this program could result in potentially devestating #
# loss to your data. Again, BE CAREFUL! #
####################################################################
####################################################################
# Background: #
# ----------- #
# #
# On some web hosts, if Links.cfg is set to build directories with #
# permission of 0755, you may not be able to delete those created #
# directories, or their corresponding index.html files. This is #
# because nph-build.cgi is executed from the web, and thus the #
# directories and files created are assigned as belonging to user #
# "nobody" and not your own User ID. #
# #
# When this is the case, you cannot delete those directories or #
# files from FTP or from Telnet; you get a Permission Denied error.#
# #
# The only way to circumvent this error, is to delete the files #
# from the web browser, acting again as user "nobody." #
# #
# If you ran nph-build.cgi from the telnet command line, the files #
# will be assigned your own User ID, and you should not have a #
# problem deleting them through FTP, telnet, or UNIX command line. #
# Also, since the owner is listed as your User ID, Wipeout! may #
# not work from the web because the web would be considered user #
# "nobody" and thus not have appropriate permission. #
# #
# Thus, files created from the web need to be deleted by running #
# Wipeout! from the web, and files created from command line in #
# telnet, need to be deleted from command line or FTP. #
# Make sense? :) #
# #
# Instructions: #
# ------------- #
# #
# 1) Set the $dir_path variable to the top of the directory that #
# you want deleted. #
# #
# 2) Execute wipeout.cgi #
# #
####################################################################
# Read the Note: below before you set this variable & execute the program!
$dir_path = "/path/to/the/root/of/the/directory/structure/you/want/deleted";
# Note: $dir_path is the directory whose contents, in and under, you
# want deleted. BE VERY CAREFUL WHEN SETTING THIS PATH!!
# If you have your Links data directories in the directory
# called /search/ then you would set the path to:
# $dir_path = "/path/to/search";
# and this program will wipeout everything in search...all of
# search
s files, subdirectories, and the subdirectory
s files.
# WARNING: If you set that path to your base (root) directory,
# you very well may wipe out your entire website. BE VERY CAREFUL!!!
use File::Path
print "Content-type: text/html";
print "<HTML><HEAD><TITLE>Wipeout! Version 1.0</TITLE></HEAD>";
print "<BODY TEXT="#000000" BGCOLOR="#FFFFFF">";
print "<STRONG>Deleting Files in $dir_path:</STRONG>";
rmtree([$dir_path], 1, 1);
print "<STRONG>Done!</STRONG>";
print "</BODY></HTML>";
# yes, tons of comments, just for a 9 line program :)