New smxi option: -X <some script>#<download url>
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4128
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
Now you can run any script you want as an extra post upgrade option in smxi.

All that is required is to supply this with the -X option: <script name>#<script download url>

smxi will rename the script to whatever you put in the <script name> part. Do not use spaces.

The actual file name, the first part, doesn't matter at all by the way, that's just what the file will be renamed to and set as executable and run as in /usr/local/bin, the only thing that actually matters is the file url, and that you provide some name for smxi to use.

It will download, chmod +x, then start, the script, from the post du options section. It will appear as an extra option, like so: run-myclean.sh, for example.

smxi tests for the script's existence, then downloads and runs it when you request the post du option, number 7 I think currenlty, but it will say: run-<script name> so you'll know.

What about running local files?
This is retrieved and tested using wget, and I'm not going to try to make it more specialized than that, so I'd recommend setting up an account and putting your file on some free server, like 741.com, then creating a shortcut url to it, dyndns.com is good for that, they have a good selection of domain names, and if you set the path to the file itself, you can always have it handy no matter where you are, like: my-cleanup-file.
www.dyndns.com/services/dns/dyndns/domains.html
so: my-cleanup-file.mine.nu could be the path to your file on some webserver somewhere, including your own. That's just an example.

If you set up a localhost webserver, you can use that, like so:

smxi -X myscript#localhost/myscript

For example, create a file called fred, with these contents:

:: Code ::
#! /bin/bash
echo hello
echo world
read response


and place it here /var/www/fred (assuming you're using default apache 2 localhost information location.

Then: smxi -X fred#localhost/fred
and it will run it fine. You can also just create a symbolic link to your file in /var/www, or wherever the default web server localhost location is.

You will see the added option when you get to the Post Upgrade options, currently number 7, called, in this case: run-fred

After smxi runs, the script will be available using the name you provided, in /usr/local/bin, which is in the default system path, so you just type its name to start it.

Over time I might add some good but very specialized utility scripts that you can run, and of course, you can make your own, or use ones that are out there already on the web.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours