These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for manually creating Custom Commands on the new forum.
Ubuntu 14.04 .. local development.
My Custom Commands are located in file pairs in /etc/webmin/custom.
e.g. 1438509195.cmd 1438509195.html
If I wish to create a batch of these file pairs manually - instead of through webmin main GUI - what is the indexing system used to create the 10 digit file names?
Is there a file naming method in webmin I can call?
I've looked through custom-lib.pl to find reference to index 'id' (10 digit number) which prefixes command files in /etc/webmin/custom
# Save a custom command
&open_lock_tempfile(FILE, ">$module_config_directory/$c->{'id'}.cmd");
# Save HTML description file
&lock_file("$module_config_directory/$c->{'id'}.html");
but it's still not clear how/where the file id's are created.
Later edit:
I tried cloning an existing (working) file set and changed the file id's manually using a random 10 digit number - 9123456789.cmd and 9123456789.html. I then restarted webmin.
This approach works and I see custom commands added in webmin.
But it would be interesting to understand the indexing method.
The file id appears to be a timestamp, in seconds since January 1, 1970. Try a web search for
unix date in seconds
and you will find recipes (and websites) for generating your own.