User:AnomieBOT/source/bot-wrapper.sh

From Wikipedia, the free encyclopedia
#!/bin/bash

## Simple wrapper around bot-instance.pl.

cd "$(dirname "${BASH_SOURCE[0]}")"

# Set LANG=C to reduce Perl memory usage.
export LANG=C

# Run bot-instance.pl, restarting it if it dies.
until ./bot-instance.pl "$@"; do
    echo "Process exited with code $?! Restarting..." >&2
done