Add matrixbot source to repo
All bot source files from LXC 151 (/opt/matrixbot) are now tracked here. Secrets (.env, credentials.json), venv dirs, and runtime state files (nio_store, welcome_state.json, wordle_stats.json) are excluded via .gitignore. Includes deploy.sh to sync files to /opt/matrixbot and restart the service. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
# Deploy script for matrixbot on LXC 151
|
||||
# Run as root on LXC 151: bash /opt/matrixbot/deploy.sh
|
||||
set -e
|
||||
|
||||
REPO_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
BOT_DIR="/opt/matrixbot"
|
||||
SERVICE="matrixbot"
|
||||
|
||||
echo "[deploy] Pulling latest from git..."
|
||||
cd "$REPO_DIR"
|
||||
git pull
|
||||
|
||||
echo "[deploy] Syncing source files to $BOT_DIR..."
|
||||
FILES="bot.py callbacks.py commands.py config.py utils.py welcome.py wordle.py wordlist_answers.py wordlist_valid.py requirements.txt"
|
||||
for f in $FILES; do
|
||||
cp "$REPO_DIR/$f" "$BOT_DIR/$f"
|
||||
done
|
||||
|
||||
echo "[deploy] Restarting $SERVICE..."
|
||||
systemctl restart "$SERVICE"
|
||||
sleep 2
|
||||
systemctl is-active "$SERVICE" && echo "[deploy] Done — $SERVICE is running." || echo "[deploy] ERROR — $SERVICE failed to start."
|
||||
Reference in New Issue
Block a user