基础参数调用

#!/bin/bash
echo $1
echo $2

#调用方法
bash test.sh param1 param2

start stop restart

#!/bin/bash

case $1 in 
    start)
        nohup ./bjsgjs 2>&1 >> info.log 2>&1 /dev/null &
        echo "bjsgjs服务已启动..."
        sleep 1
    ;;
    stop)
        killall bjsgjs
        echo "bjsgjs服务已停止..."
        sleep 1
    ;;
    restart)
        killall bjsgjs
        sleep 1
        nohup ./bjsgjs 2>&1 >> info.log 2>&1 /dev/null &
        echo "bjsgjs服务已重启..."
        sleep 1
    ;;
    *) 
        echo "$0 {start|stop|restart}"
        exit 4
    ;;
esac