gpt4 book ai didi

Linux脚本启动、停止、重启

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:14:38 30 4
gpt4 key购买 nike

<分区>

谁能告诉我这个脚本到底做了什么?

#! /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

我想知道这部分到底是什么:

#! /bin/sh
test –f /usr/bin/sshd || exit 0
case “$1” in
start)
echo –n “Starting sshd: sshd”
/usr/sbin/sshd
echo “.”
;;

因为其他部分是一样的!请 ;)

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com