Skip to content

Instantly share code, notes, and snippets.

@Mte90
Last active January 28, 2021 09:55
Show Gist options
  • Save Mte90/928104c7a3897641cb0c36719f8946fb to your computer and use it in GitHub Desktop.
Save Mte90/928104c7a3897641cb0c36719f8946fb to your computer and use it in GitHub Desktop.
Auto update Mozilla Italia bot and restart them on unix system
#!/usr/bin/env bash
cd /opt/mozita/
cd ./mozitaantispam_bot/
git fetch --all
if [[ $(git rev-list HEAD...origin/master --count) -ne 0 ]]; then
pkill -f antispam_mozita.py
git stash
git pull
nohup python3 -u ./antispam_mozita.py > cmd.log &
fi
cd ../
cd ./mozitahub_bot/
git fetch --all
if [[ $(git rev-list HEAD...origin/master --count) -ne 0 ]]; then
pkill -f hub_mozita.py
git stash
git pull
nohup python3 -u ./hub_mozita.py > cmd.log &
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment