From: Vincent Le Gallic Date: Sun, 20 Oct 2013 22:43:43 +0000 (+0200) Subject: Scripts de feignasse pour faire plusieurs fois ~la même chose X-Git-Url: http://gitweb.pimeys.fr/?p=scripts-20-100.git;a=commitdiff_plain;h=42c8bd2c6a1e7ddd71f7320ff4a50f3a49764301 Scripts de feignasse pour faire plusieurs fois ~la même chose --- diff --git a/all_bots b/all_bots new file mode 100755 index 0000000..62e683a --- /dev/null +++ b/all_bots @@ -0,0 +1,41 @@ +#!/bin/bash + +# Pour envoyer une instructions à tous les bots en même temps + +bots=('basile' 'deconnaisseur' 'hung' 'historien' 'salesman' 'saturnin' 'themis') # 'ibot') + +cmd=$1 +case $cmd in + kill) + echo "Warning, killing all processes of users : ${bots[*]}" + for bot in ${bots[*]} + do + sudo pkill -u $bot + done + ;; + start|stop|restart|reload) + for bot in ${bots[*]} + do + sudo service $bot $cmd + done + ;; + status) + for bot in ${bots[*]} + do + service $bot $cmd + done + ;; + update|pull|maj) + for bot in ${bots[*]} + do + cd /home/$bot/$bot + sudo -u $bot git pull + done + ;; + list|who) + echo "Liste des bots : ${bots[*]}" + ;; + *) + echo "Usage: all_bots {kill|start|stop|reload|restart|update|status}" + ;; +esac diff --git a/restart_ii b/restart_ii new file mode 100755 index 0000000..da5c268 --- /dev/null +++ b/restart_ii @@ -0,0 +1,16 @@ +#!/bin/bash + +# Relancer les process ii habituellement lancés sur cerebro +# Obsolète, j'utilise maintenant KGB + +# Just in case +killall ii + +ii -i /home/vincent/iirc/gitTest/ -s irc.crans.org -n gitTest & +echo "/j #tests" > /home/vincent/iirc/gitTest/irc.crans.org/in + +ii -i /home/vincent/iirc/gitThemis/ -s irc.crans.org -n gitThemis & +echo "/j #déprime" > /home/vincent/iirc/gitThemis/irc.crans.org/in + +ii -i /home/vincent/iirc/git20-100/ -s irc.crans.org -n git20-100 & +echo "/j #note" > /home/vincent/iirc/git20-100/irc.crans.org/in