Last active
March 23, 2025 23:01
-
-
Save Neodevils/bb3a447e71d3ae21e399616de1fa9ab2 to your computer and use it in GitHub Desktop.
Connecting Your GitHub Repository to Pterodactyl Panel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Hata alırsa durdur | |
set -e | |
# Eğer kaeru dizini varsa, .env dosyasını yedekle ve güncelle; yoksa, repo'yu klonla | |
if [ -d "/home/container/kaeru" ]; then | |
echo "Kaeru dizini bulundu, güncellemeleri çekiyoruz..." | |
cd /home/container/kaeru | |
# .env dosyası varsa yedekle | |
if [ -f ".env" ]; then | |
echo ".env dosyası bulundu, yedekliyoruz..." | |
cp .env ../.env_backup | |
fi | |
# Reset yapıp güncellemeleri çek | |
git reset --hard origin/master | |
git pull origin master --force | |
# Eğer yedek .env dosyası varsa, geri yükle | |
if [ -f "../.env_backup" ]; then | |
echo ".env dosyası yedekten geri yükleniyor..." | |
mv ../.env_backup .env | |
fi | |
else | |
echo "Kaeru dizini bulunamadı, repo'yu çekiyoruz..." | |
git clone https://github.com/minesa-time/kaeru /home/container/kaeru | |
fi | |
# Bağımlılıkları yükle (package.json dosyası /home/container/kaeru içinde bulunuyor) | |
cd /home/container/kaeru | |
npm install --force | |
# Çalışan eski instance varsa öldür | |
pkill -f "npm run dev" || true | |
# node_modules dizini varsa dev modunda, yoksa start modunda başlat | |
if [ -d "/home/container/kaeru/node_modules" ]; then | |
echo "node_modules dizini bulundu, dev modunda başlatıyoruz..." | |
cd /home/container/kaeru/src && npm run dev || echo "Bot çalıştırılamadı!" | |
else | |
echo "node_modules dizini bulunamadı, start modunda başlatıyoruz..." | |
cd /home/container/kaeru/src && npm run start || echo "Bot çalıştırılamadı!" | |
fi | |
# Konsolu açık tut | |
tail -f /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment