#!/bin/bash if [ $# -ne 2 ] then echo"jobs path error!" exit 99 else echo"start $1 jobs!" if [ $1 = "service" ] then su - service -s /bin/bash /home/$1/$2/start.sh $1$2 elif [ $1 = "www" ] then su - www -s /bin/bash /home/$1/html/$2/start.sh $1$2 fi fi
deploy.sh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/bash if [ $# -ne 2 ] then echo"jobs path error!" exit 99 else echo"deploy $1 jobs!" if [ $1 = "service" ] then su - service -s /bin/bash /home/$1/$2/deploy.sh $1$2 elif [ $1 = "www" ] then su - www -s /bin/bash /home/$1/html/$2/deploy.sh $1$2 fi fi
if [ $# -ne 2 ] then echo"jobs path error!" exit 1 else echo"deploy $1/html/$2 jobs!" deploy_dir="/home/$1/html/$2" if [ -d "$deploy_dir" ] then cd$deploy_dir git pull else echo"Please clone the job($1/html/$2) from gitlab first!" fi fi