diff --git a/README.md b/README.md new file mode 100644 index 0000000..e3c0266 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# Silly alive watchdog + +Is [Nando](http://www.imdb.com/title/tt0106246/characters/nm0000160) alive? + +At server side, run `nandod` with suitable arguments + +At clients, run `nando -i 600` to update status every 10 minutes. + +You can send a custom text file with the update, generated with ex. `nando-desc` + +Nando clients can query which other clients are online, and what their status is +(whatever you choose to update with the text data) + diff --git a/etc/nandorc.example b/etc/nandorc.example new file mode 100644 index 0000000..9c34f1d --- /dev/null +++ b/etc/nandorc.example @@ -0,0 +1,8 @@ +# host name for nandod +HOST = 5.39.76.124 +# port for nandod +PORT = 13375 +# text file to send at every update +# generate with nando-desc or nando-stats in cron +MSGFILE = /dev/shm/nando.msg + diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..8629a6e --- /dev/null +++ b/install.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +[[ $UID -eq 0 ]] || { + echo Run as root to install in /usr/local/bin >&2 + exit 1 +} + +for f in nando nandod nando-desc nando-stats; do + cp -vi "$f" /usr/local/bin/ + chmod a+rx /usr/local/bin/"$f" +done +echo "Copy etc/nandorc.example /etc/nandorc and edit it!" + diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..d4e70cb --- /dev/null +++ b/update.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +[[ $UID -eq 0 ]] || { + echo Run as root to install in /usr/local/bin >&2 + exit 1 +} +which curl &>/dev/null || { + echo No curl command found, can not update >&2 + exit 1 +} +set -e +for f in nando nandod nando-desc nando-stats; do + curl -s https://bitbucket.org/MoonQ/nando/raw/tip/$f > /usr/local/bin/$f + chmod a+rx /usr/local/bin/"$f" +done +echo "Copy https://bitbucket.org/MoonQ/nando/raw/tip/etc/nandorc.example to /etc/nandorc and edit it!" +curl -s https://bitbucket.org/MoonQ/nando/raw/tip/etc/nandorc.example +