+ Responder ao Tópico



  1. #1
    Moderador Avatar de Bruno
    Ingresso
    Nov 2002
    Localização
    Guarapuava-PR
    Posts
    3.928
    Posts de Blog
    1

    Padrão Shell para php

    pessoal tenho alguns script em shell bash

    e to afim de tranformar eles em php pra ficar mais bonitinho

    segue meu script
    #! /bin/sh

    echo -n " Informe o Dominio : "
    read dominio
    echo -n " Informe o IP Primario : "
    read ippri

    echo -n " Informe o IP Secundario : "
    read ipsec
    echo " " >> /mydnsche/etc/named.conf
    printf "zone \"$dominio\" IN { \n" >> /mydnsche/etc/named.conf
    echo " type master;" >> /mydnsche/etc/named.conf
    printf " file \"$dominio\"; \n" >> /mydnsche/etc/named.conf
    echo "};" >> /mydnsche/etc/named.conf

    touch /mydnsche/var/named/$dominio

    echo '$TTL 86400' >> /mydnsche/var/named/$dominio
    echo "@ IN SOA ${dominio}. hostmaster.${dominio}. (" >> /mydnsche/var/named/$dominio
    echo " 0000000001" >> /mydnsche/var/named/$dominio
    echo " 3600" >> /mydnsche/var/named/$dominio
    echo " 900" >> /mydnsche/var/named/$dominio
    echo " 604800" >> /mydnsche/var/named/$dominio
    echo " 86400 )" >> /mydnsche/var/named/$dominio
    echo " " >> /mydnsche/var/named/$dominio
    echo " IN NS ns1.${dominio}." >> /mydnsche/var/named/$dominio
    echo " IN NS ns2.${dominio}." >> /mydnsche/var/named/$dominio
    echo " IN MX 10 mail.${dominio}." >> /mydnsche/var/named/$dominio
    echo " IN A $ippri" >> /mydnsche/var/named/$dominio
    echo "ns1 IN A $ippri" >> /mydnsche/var/named/$dominio
    echo "ns2 IN A $ipsec" >> /mydnsche/var/named/$dominio
    echo "mail IN A $ippri" >> /mydnsche/var/named/$dominio
    echo "www IN A $ippri" >> /mydnsche/var/named/$dominio
    echo "ftp IN A $ippri" >> /mydnsche/var/named/$dominio

    touch /mydnsche/etc/apache/dominios/$dominio
    mkdir /mydnsche/var/www/pages/$dominio -p
    echo "<VirtualHost www.${dominio}>" >> /mydnsche/etc/apache/dominios/$dominio
    echo " ServerAdmin [email protected]${dominio}" >> /mydnsche/etc/apache/dominios/$dominio
    echo " DocumentRoot /var/www/pages/${dominio}" >> /mydnsche/etc/apache/dominios/$dominio
    echo " ServerName www.${dominio}" >> /mydnsche/etc/apache/dominios/$dominio
    echo " ServerAlias ${dominio}" >> /mydnsche/etc/apache/dominios/$dominio
    printf " ScriptAlias /cgi-bin/ \"/var/www/pages/${dominio}/cgi-bin/\" \n" >> /mydnsche/etc/apache/dominios/$dominio
    echo " ErrorLog /var/log/apache/dominios/${dominio}-error.log" >> /mydnsche/etc/apache/dominios/$dominio
    echo " CustomLog /var/log/apache/dominios/${dominio}-access.log combined" >> /mydnsche/etc/apache/dominios/$dominio
    echo "<Directory /var/www/pages/${dominio}>" >> /mydnsche/etc/apache/dominios/$dominio
    echo " Options Indexes Multiviews" >> /mydnsche/etc/apache/dominios/$dominio
    echo " AllowOverride None" >> /mydnsche/etc/apache/dominios/$dominio
    echo " Order Deny,Allow" >> /mydnsche/etc/apache/dominios/$dominio
    echo " Allow From All" >> /mydnsche/etc/apache/dominios/$dominio
    echo "</Directory>" >> /mydnsche/etc/apache/dominios/$dominio
    echo "</VirtualHost>" >> /mydnsche/etc/apache/dominios/$dominio



    elguem pode me ensinar a escrever eles em php

  2. #2
    Moderador Avatar de Bruno
    Ingresso
    Nov 2002
    Localização
    Guarapuava-PR
    Posts
    3.928
    Posts de Blog
    1

    Padrão Shell para php

    alguma dica ???