scripts

shell scripts
git clone git://git.bitsmanent.org/scripts
Log | Files | Refs | README

commit e47fb77c09793d22ddb97a26393704153d0efb4f
parent 8846191dd3931616007cd803f9aabce93bf4c487
Author: clamiax <smoppy@gmail.com>
Date:   Fri, 22 May 2015 17:51:04 +0200

Add a simple web stack switch

Diffstat:
MREADME.md | 5+++++
Aswss | 31+++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md @@ -74,3 +74,8 @@ supports pkgsrc-wip. whexsafe -------- Generates the web safe colors list in hex and RGB formats. + +swss +---- +Simple web stack switch. It just tiny script to start and stop a group of +services which I use to deal with my web stack (redis, mysql, nginx, etc.). diff --git a/swss b/swss @@ -0,0 +1,31 @@ +#!/bin/bash +# simple web stack switch + +services=( + redis-server + mysql + nginx + php5-fpm +) + +massact() { + act=$1 + for s in ${services[@]} + do + service $s $1 & + done +} + +main() { + case $1 in + start);; + stop);; + restart);; + status);; + *) echo "Usage: $0 [start|stop|restart|status]" ; exit 1 ;; + esac + + massact $1 +} + +main "$@"