Paste First Effect:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/76/88/wKiom1ZVfpizUjo_AAJ_J1ZZEdE088.jpg "title=" Qq20151125172342.jpg "alt=" Wkiom1zvfpizujo_aaj_j1zzede088.jpg "/>
#!/bin/bash#auth:[email protected]source/etc/init.d/functions# Judging number of parameters [$#-ne 1]&&{echo "usage:$0 {start|stop |restart|status} "Exit 1} #分支case Instart) nohup watch-n 1 Date" +%h:%m:%s "&>/tmp/date &action" Starting $ " /bin/true;; Stop) Pkill watchaction "stoping"/bin/true;; Restart) Pkill watchnohup watch-n 1 Date "+%h:%m:%s" &>/tmp/date &action "restarting $"/bin/true;; Status) status= ' Ps-ef |grep-v grep|grep "watch-n" |wc-l ' [$status-ne 0] && action "status of $ is running"/b in/true| | Action "Status of $ is stoped"/bin/false;; *) echo "usage:$0 {start|stop|restart|status}";; Esac
This article is from the "Advance Bar Rookie" blog, please make sure to keep this source http://chentp.blog.51cto.com/10638759/1716825
Linux Bash startup stop script that can be applied