#functions public function
/etc/init.d/functions
#call function
source /etc/init.d/functions . /etc/init.d/functions
# Daemon to start form
daemon /usr/local/nginx-1.16.0/sbin/nginx
# Exit the current process
killproc /usr/local/nginx-1.16.0/sbin/nginx
# View the process
pidofproc /usr/local/nginx-1.16.0/sbin/nginx
# Simple startup script
#!/bin/bash #================================ # this is simple launched script # author: xianwei # date: 2019-5-31 #================================ #include functions . /etc/init.d/functions function start(){ daemon /usr/local/nginx-1.16.0/sbin/nginx } function stop(){ killproc /usr/local/nginx-1.16.0/sbin/nginx } case "$!" in start) start ;; stop) stop ;; restart) stop start ;; *) echo "USAGE: nginx{start|stop|restart} ;; esac exit 0