• 25-03-2014, 23:59:30
    #10
    AndyCap adlı üyeden alıntı: mesajı görüntüle
    @Squit /dev/tcp gerçek bir device node değil. Onu görememeniz normal yani.


    Sizden istediğim konuda yazdığınız ilk scripti ksh ile çalıştırmanız.
    bu ksh dediğiniz tam olarak nedir hocam ben bu dilden baya uzağım
  • 26-03-2014, 00:16:58
    #11
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Bash shell ve Korn shell Unix sistemlerde kullanılan shell çeşitleri.
  • 27-03-2014, 01:36:51
    #12
    Squit adlı üyeden alıntı: mesajı görüntüle
    nc -zv 127.0.0.1 3306 < /dev/null; echo $?
    if [ $? == "0" ]; then
        echo "Telnet accepting connections"
    else
        echo "Telnet connections not possible"
    fi
    bu scripti ./kontrol.sh - sh kontrol.sh

    başına bin/bash - bin/sh ekledim hepsinde denedim hepsinde ise aldığım hata

    Syntax error: "fi" unexpected (expecting "then")

    bu
    başına hiçbir şey eklemeden aşağıdaki gibi çalışması lazım.

    nc -z 127.0.0.1 3306 < /dev/null
    if [ $? == "0" ]; then
        echo "Telnet accepting connections"
    else
        echo "Telnet connections not possible"
    fi
    Alıntı
    [root@www ~]# sh kon.sh
    Connection to 127.0.0.1 3306 port [tcp/mysql] succeeded!
    Telnet accepting connections
    veya tek satır çıktı istiyorsanız

     nc -z 127.0.0.1 3306 1>/dev/null 2>&1; result=$?;
     if [ $result -eq 0 ]; then
         echo "Telnet accepting connections"
     else
         echo "Telnet connections not possible"
     fi
  • 28-03-2014, 16:06:08
    #13
    victories adlı üyeden alıntı: mesajı görüntüle
    başına hiçbir şey eklemeden aşağıdaki gibi çalışması lazım.

    nc -z 127.0.0.1 3306 < /dev/null
    if [ $? == "0" ]; then
        echo "Telnet accepting connections"
    else
        echo "Telnet connections not possible"
    fi


    veya tek satır çıktı istiyorsanız

     nc -z 127.0.0.1 3306 1>/dev/null 2>&1; result=$?;
     if [ $result -eq 0 ]; then
         echo "Telnet accepting connections"
     else
         echo "Telnet connections not possible"
     fi
    nc -z 127.0.0.1 3306 1>/dev/null 2>&1; result=$?; 
    if [ $result -eq 0 ]; then 
    echo "port acik" 
    else 
    /usr/local/etc/rc.d/mysql-server start
    echo "port aciliyor"
    fi
    sistemin çıktısı budur hata neden kaynakldır sizce
    root@elvan:/root # sh kontrol.sh
    : not found
    : not found
    '.sr/local/etc/rc.d/mysql-server: unknown directive 'start
    Usage: /usr/local/etc/rc.d/mysql-server [fast|force|one|quiet](start|stop|restart|rcvar|status|poll)
    port aciliyor
  • 28-03-2014, 17:25:07
    #14
    sisteminde netcat kurulu olduğuna emin misin? nc komutuna notfound diyor sanırım.
  • 28-03-2014, 18:20:40
    #15
    victories adlı üyeden alıntı: mesajı görüntüle
    sisteminde netcat kurulu olduğuna emin misin? nc komutuna notfound diyor sanırım.
    netcat kurulu onu sadece yazınca bir problem yok ancak başka bir yerde bir eksik var anlayamadım