From 42c8bd2c6a1e7ddd71f7320ff4a50f3a49764301 Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Mon, 21 Oct 2013 00:43:43 +0200 Subject: [PATCH] =?utf8?q?Scripts=20de=20feignasse=20pour=20faire=20plusie?= =?utf8?q?urs=20fois=20~la=20m=C3=AAme=20chose?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- all_bots | 41 +++++++++++++++++++++++++++++++++++++++++ restart_ii | 16 ++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100755 all_bots create mode 100755 restart_ii 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 -- 2.39.2