title: Linux script start,stop,restart
body: <p>Can anyone please tell me what exactly this script does?</p>
  
  <pre><code>#! /bin/sh
  test –f /usr/bin/sshd || exit 0
  case “$1” in
      start)
              echo –n “Starting sshd: sshd”
              /usr/sbin/sshd
              echo “.”
              ;;
     stop) 
            echo –n “Stopping sshd: sshd”
            kill `cat /var/run/sshd.pid`
            echo “.”
             ;;
     restart)
            echo –n “Stopping sshd: sshd”
            kill `cat /var/run/sshd.pid`
            echo “.”
            echo –n “Starting sshd: sshd”
              /usr/sbin/sshd
              echo “.”
              ;;
          *)
            echo “Usage: /etc/init.d/sshd start|stop|restart”
            exit 1
            ;;
      esac
  </code></pre>
  
  <p>I want to know what exactly this part:</p>
  
  <pre><code>#! /bin/sh
  test –f /usr/bin/sshd || exit 0
  case “$1” in
      start)
              echo –n “Starting sshd: sshd”
              /usr/sbin/sshd
              echo “.”
              ;;
  </code></pre>
  
  <p>does because the other part is the same!
  Please ;)</p>