I am preparing an installer script for a software following the documentation here:
but I run into a problem:
After uploading the .pl file to /usr/libexec/webmin/virtual-server/scrips (CentOS 5) the new script is not visible in the list of available installer scripts in Virtualmin web interface. I tried restarting webmin - no result. I tried to change the description string of one of the original scripts to see of it will change in the web interface list - it does not change.
What should I refresh/reload/recompile in order for the new script to be available in the web interface?
I found the problem - my script had a syntax error.
I have new issue though: is there a way to download the file for the installation from a password protected site? I tried to use ‘url’ => “http://username:firstname.lastname@example.org”, but it does not work. Any ideas?
You should indeed be able to use a URL such as this to access a password protected repository:
What you may want to do is try using your browser or something similar to access the repository, and see if it works in that case.
Thanks for the reply!
I tried couple of times to make it work with: http://USERNAME:PASSWORD@domain.tld with no success.
With ‘url’ => “http://username:email@example.com” the installer script returns error 401 “authorization required” while still displaying the right URL “http://username:firstname.lastname@example.org”.
I found a solution though:
After quick review of scripts-lib.pl i discovered a user and pass variables passed to the function to actually download the file. I tested with:
‘url’ => “http://repo.server.com/file-ver.zip”,
‘nocache’ => 1,
‘user’ => “username”,
‘pass’ => “password”
and it works.
I don’t know if this variables was intended for that use, because I didn’t trace the code further but the problem is more likely solved.
There is one more thing: Do you know how the routine for upgrades is all linked together? I see there is this function script_scriptid_latest which is used to return the latest version number, but how is this used further? Is it just used to display if you are using the latest possible version or something more? How is working the upgrade notification?
Well, in the case of Squirrelmail – if one day you use the Install Script to install Squirrelmail version 1.4.1… that version number would be in a config file associated in with your installation.
The Install Script has a function “script_squirrelmail_versions”.
I believe what happens is that one day, if the value returned by “script_squirrelmail_versions” is newer than what’s in your config file for what you have installed, Virtualmin will then be triggered to perform an upgrade notification.
Does that answer your question?
In order for the new version to be available to install we should upgrade the installer script itself manually, right? Because the version is statically defined there and also the install process could be version dependent, so we cannot upgrade the version of the script before to upgrade the installer script itself (am I right?). Is there a routine to automatically check for updates and upgrade the installer script (then also sending notifications about the new version available to install/upgrade)?