#!/usr/bin/perl # # TG's little web adder to be used with the sample httpd.conf ADDUSER: system("clear"); print "\e[7m TG's Web Host Adder \e[0m\n\n\n"; USERNAME: print "\tPlease enter the username of the person who will own this domains\n"; print "\tThey must have already been created with webmin before you can do this\n"; print "\tnumeric charatcer.\n\n"; print "Username: "; $username=; chop($username); open(PWFILE, "/etc/passwd"); while() { if($_ =~ /^$username:/) { $checkuser="EXISTS"; } } close(PWFILE); if ($checkuser ne "EXISTS") { print "\n$username does not exist!\n\n"; sleep 2; goto USERNAME; } DOMAIN: system ("clear"); print "\nPlease enter the domain name to be created for $username in the format of www.mydomain.com: "; $domain=; chop($domain); system ("mkdir /www/domains/$domain"); system ("mkdir /www/domains/$domain/html"); system ("mkdir /www/domains/$domain/html/cgi-bin"); symlink ("/www/domains/$domain" , "/home/$username/$domain"); system ("chown -R $username.web /www/domains/$domain"); print "\nDomain $domain for $username has been added successfully...\n"; sleep 3; ;exit