Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Remove/Deinstall Links From Url or script

Quote Reply
Remove/Deinstall Links From Url or script
Hi,

The normal way to de-install Links is to manually remove the files from the directory.

Is there an add-on or a script that allow to remove Links through an URL (i.e. ...admin.cgi?remove...) that could be used to delete a distant and temporary installation, such as for a demonstration purpose (with a "remove button").

Or is there a way to modify the original script to achieve such result ?



Many thanks for any help.
Quote Reply
Re: [nono] Remove/Deinstall Links From Url or script In reply to
Nope.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [nono] Remove/Deinstall Links From Url or script In reply to
Interesting suggestion.

As Andy mentioned, there is currently no "remove" feature in the ADMIN.CGI script.

But it would be possible using system commands like cd and rm - r * and rmdir, of course, should only be programmed if your have your admin.cgi secured. You'd basically have to connect to all the Links folders (New, Cool, Top, Category) and remove all files and sub-folders, then remove the "index.html" in the root.

But the easiest thing to do is simply FTP to your account and remove all the files as you already stated.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Remove/Deinstall Links From Url or script In reply to
Ok, lets say we want to make a remove.cgi script that we could call from an url like http://Mylinkstemporaryordemonstrationsite/links/admin/remove.cgi.

Lets say that our pages directory is in the same directory than links (.../links/admin, .../links/pages)

Lets say that our admin directory is password protected.

Since I am not a code warrior, but only a readme.txt reader could you please help me in writing this little routine ?



Many thanks if you can (even if ou cannotWink).
Quote Reply
Re: [nono] Remove/Deinstall Links From Url or script In reply to
Not really a little routine. As Stealth said, you could do it with a couple of commands in SSH;

rm -R -f /path/to/your/admin/*
rm -R -f /path/to/your/pages/folder/*

Careful with these commands.. if you want to manually see what file its removing, remove the -f option.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Remove/Deinstall Links From Url or script In reply to
Ok,

Lets say I have written a file which name is remove.cmd (in a windows server)

del C:\test\EasyPHP\www\pages\ /S /F /q
rd C:\test\EasyPHP\www\pages\ /S /q

del C:\test\EasyPHP\cgi-bin\links\ /S /F /q

I can invoque this file through http://mytestserver/links/admin/remove.cmd as long as the .cmd are authorized, which is rare.

The same, I think, for Unix server (delete.sh with rm -f -R commands). I'm not sure that .sh file are allowed in web directories.

So, what would be the equivalent in .cgi, ie in perl, language. I'm sorry to ask so stupid questions but I know neary nothing about perl.



Many thanks, again and again.
Quote Reply
Re: [nono] Remove/Deinstall Links From Url or script In reply to
You don't really need to do this in Perl. You can use Unix system commands to do the same:

Like:

Code:
#!/bin/sh
# Connect to Links Folders

cd /path/to/links/
rm - r *
cd /path/to
rmdir links

Save the file as remove_links.sh.

Then from the command line in your server, run the following command:

Code:
bash remove_links.sh

The above will all at once delete all files/folders in your links folder and also delete the links folder.

But again, it would be just as easy to FTP or telnet into your account and manually delete the files and folders.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Remove/Deinstall Links From Url or script In reply to
Thank you for the file !!

The reason why I would prefer a perl file is that when I'm installing a ready to use links demo, I can work directly on the server. So of course, I could copy the .sh file into the directory. But I long as it is demo servers, there is no real webmaster that create groups and accounts... More, when the demo is over, I'm often away. So, the best way to be sure that everything is ok, is to protect the admin directory with a password and to be abble to remove the file from a .cgi script because there is no ftp or telnet daemon.

Thank you again for your help.
Quote Reply
Re: [nono] Remove/Deinstall Links From Url or script In reply to
No FTP or telnet daemon???....Hmm, how the heck do you install Links then??? Tongue
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] Remove/Deinstall Links From Url or script In reply to
Lets say you are working directly on the server. For example, on a windows server I am working with the file manager. There is only a webserver running (IIS or Apache).

On an unix server, I also work directly on the console, I copy my files from a cd with a cp command into the web directory. Most of the time I leave when the Link installation is up and running.

So the easiest way for me to be sure that everything is removed, in spite of asking somobody else to do it, is to provide a remove script.

Would it be that difficult to write it in perl ?

Lets say remove.cgi

#!C:\test\perl\bin\perl

require "links.cfg";

rmdir($db_script_path);

rmdir($build_root_path);



This would be nice but doesn't work ! Would you please help me ?

Last edited by:

nono: Sep 23, 2003, 7:56 AM
Quote Reply
Re: [nono] Remove/Deinstall Links From Url or script In reply to
you need to use system codes in there.

Like the following:

Code:
system(rmdir $db_script_path);

Although you may have to use rm - r * as I mentioned above already.

Check out Google for system Perl for more information.
========================================
Buh Bye!

Cheers,
Me