Automation, Dreamhost Control Panel

software development

#1

Heyhey!

Didnt know if I should post this in troubleshooting or programming so posting here :slight_smile:

Is there some other way of automating creation of subdomains and/or conditional skeleton setups than using wget or other simulated user agents? Using for example XMLRPC?


#2

This has actually come up a few times before in the past few months. All such things (Domains, sub-domains, databases, E-mail, etc.) must be passed through the panel. You can set up a script to take the info submitted on your website, authenticate it self with the panel, and submit the information.

Keep in mind that you are responsible for all content store on your account, so if a user comes and puts up illegal sutff, or starts spamming, you’ll take all the heat and might well loose your account.

–Matttail
art.googlies.net - personal website


#3

Alright, so have to simulate user agents some way then… been fiddling with a script to create a subdomain and this is what I’ve got thusfar:

[code]#!/bin/sh

USER=
PASS=
DOMAIN=

Shouldn’t have to edit anything beyond this point

DELA="–delete-after"
COOKIEFILE=“cookies"
LOADSAVECOOKIES=”–save-cookies $COOKIEFILE --load-cookies $COOKIEFILE"
OUTFILE=“output.html"
PARMS=”–no-check-certificate"

wget $PARMS --save-cookies $COOKIEFILE $DELA "https://panel.dreamhost.com/"
wget $PARMS $LOADSAVECOOKIES $DELA --post-data=“Nscmd=Nlogin&username=$USER&password=$PASS&” https://panel.dreamhost.com/index.cgi
wget $PARMS $LOADSAVECOOKIES -O $OUTFILE --post-data=“current_step=ShowAddhttp&next_step=AddHttp&tree=domain.manage&domain_type=cgi&domain=&php_version=5&mod_security_on=1&usid=&relpath=&www_redir=notwww” https://panel.dreamhost.com/index.cgi
[/code]Took some (most) from Rodrigo Damazios Dynamic DNS script

This, for some reason unknown to me, doesnt work. Resulting page is some sort of advanced DNS setup for my domain. Anyone able to spot obvious errors? Is the referer header checked perhaps?


#4

Not at this time, though it would be nice.

:cool: Perl / MySQL / HTML+CSS


#5

Okay, I’ve resolved this issue with the help of an Perl script. Havent got it readily available now but if anyone is interested send me an PM and I’ll work something out.