Files
lucidia-main/scripts/phase b.ssh
blackboxprogramming 556a652b07 part b
2025-08-08 02:10:55 -05:00

18 lines
659 B
Plaintext

# --- Phase B: clone + cron ---
if ! command -v git >/dev/null; then
apt-get update && apt-get install -y git
fi
sudo mkdir -p /opt/lucidia
sudo chown -R $USER:$USER /opt/lucidia
[ -d /opt/lucidia/.git ] || git clone git@github.com:blackboxprogramming/lucidia.git /opt/lucidia
cd /opt/lucidia
git fetch --all && git reset --hard origin/main
chmod +x scripts/pull_and_restart.sh || true
# Pull every minute
( crontab -l 2>/dev/null | grep -v 'pull_and_restart.sh'; echo '* * * * * /opt/lucidia/scripts/pull_and_restart.sh >> /tmp/lucidia_cron.log 2>&1' ) | crontab -
# Test once
/opt/lucidia/scripts/pull_and_restart.sh && echo "Droplet manual deploy OK"