Newsgroup: it.comp.os.linux.sys
Titolo: [PPPD] - Connessione: come farlo via HTTP ?


#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
# $1            $2              $3              $4              $5 
         $6
# ppp0          /dev/ttyS21     115200          10.172.192.128 
10.172.192.127  PDM
PATH=$PATH:/usr/sbin:/sbin
CONN="PDM"
RUNF="/var/run/ppp-$CONN.pid"
TS="
time.ien.it
"
case "$1" in
   start)
         echo "{ [*] Bringing up ASYNC PPPD link PDM at: `date`}"
         if [ -f $RUNF ];then
                 IF=`cat $RUNF|grep ppp`
                 PID=`cat $RUNF|grep -v ppp`
                 echo "{ [*] Interface $IF is already UP }"
                 exit 1
         fi
         pppd file /etc/ppp/options.$CONN call $CONN
         sleep 17
         IF=`cat $RUNF|grep ppp`
         ifconfig $IF
         echo "{ [*] Setting up routig and NAT masquerading: }"
         sysctl -w net.ipv4.ip_forward="1"
         modprobe iptable_nat
         iptables -t nat -F
         iptables -t nat -A POSTROUTING -s 
192.168.157.0/27
 -o $IF -j 
MASQUERADE
         iptables -t nat -nvL
         echo "{ [*] Synching RTC "
         echo "  [*] LOCAL  RTC :" `date -R`
         echo "  [*] SERVER RTC :" `rdate $TS` }
         rdate -s $TS
         hwclock --systohc
         apt-get update
   ;;
   stop)
         if [ -f $RUNF ]
           then
                 IF=`cat $RUNF|grep ppp`
                 PID=`cat $RUNF|grep -v ppp`
                 echo "{ [*] Interface $IF is UP }"
                 iptables -t nat -F
                 sysctl -w net.ipv4.ip_forward="0"
                 ifconfig $IF down
                 kill $PID
                 echo "{ [*] Interface $IF disconnected at: `date` }"
           else
                 echo "{ [*] Interface $IF is NOT UP }"
                 exit 1
         fi
   ;;
   status)
         if [ -f $RUNF ]
           then
                 IF=`cat $RUNF|grep ppp`
                 echo "{ [*] Interface $IF is UP }"
                 echo "NAT:"
                 iptables -t nat -nvL|grep MASQUERADE
                 echo "Routing:"
                 sysctl net.ipv4.ip_forward
           else
                 echo "{ [*] Interface $IF is NOT UP }"
         fi
   ;;
   *)
     echo "Usage: PDM {start|stop|status}"
     exit 1
     ;;
esac
exit 0
La mia richiesta è: avere una pagina HTML/CGI/?!? sulla linux box con 
tre bottoni (start/stop/status) e che riporti i messaggi che si 
vedrebbero in console.
Esiste ?
Se no, da dove inizio a farla ?
Ineressa ad altri ?

 Ineressa ad altri ?
Con i "custom command" di webmin non dovrebbe essere un problema...

 Ineressa ad altri ?
Facilissimo! Una paginetta in php con l'utilizzo di comandi come exec o
passthru.
Ciao.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com
).
Version: 6.0.703 / Virus Database: 459 - Release Date: 10/06/2004


Io uso questo:
http://freshmeat.net/projects/pppremotecontrol/
Alessandro.