Unrealircd.cond bash ile oluşturma
Kod
#!/bin/bash
# Hata durumunda işlemi kes
set -e
# Yapılandırma Dosyası Yolu
CONF_FILE="/home/irc/unrealircd/conf/unrealircd.conf"
echo "--> Rastgele şifreler ve gizleme anahtarları üretiliyor..."
# Otomatik Rastgele Değer Üreticileri
LINK_PASS=$(openssl rand -hex 16)
CLOAK_1=$(openssl rand -hex 6 | tr 'a-f' 'g-l')
CLOAK_2=$(openssl rand -hex 6 | tr 'a-f' 'm-r')
CLOAK_3=$(openssl rand -hex 6 | tr 'a-f' 's-z')
echo "--> ${CONF_FILE} dosyası oluşturuluyor..."
# unrealircd.conf dosyasının yazılması
cat <<EOT > "$CONF_FILE"
/* Resmi ve varsayılan modüllerin yüklenmesi */
include "modules.default.conf";
include "opers.default.conf";
/* Sunucu Kimlik Bilgileri */
me {
name "irc.localhost";
info "IRC Sunucusu";
sid "001";
};
/* Yönetici İletişim Bilgileri */
admin {
"Yonetici";
"admin@localhost";
};
/* Bağlantı Sınıfları ve Trafik Limitleri */
class clients {
pingfreq 90;
maxclients 1000;
sendq 4000000;
recvq 8000;
};
class servers {
pingfreq 90;
maxclients 10;
sendq 25000000;
};
/* Giriş İzinleri */
allow {
ip "*@*";
class clients;
maxperip 10;
};
/* Dinlenen Portlar (Standart Giriş) */
listen {
ip "*";
port 6667;
};
/* Anope Servis Bağlantı Bloğu (Localhost) */
link services.localhost {
incoming {
mask { ip "127.0.0.1"; };
};
password "${LINK_PASS}";
class servers;
};
/* Ulines - Servislerin Sunucu Yetkileri */
ulines {
services.localhost;
};
/* Genel Network Ayarları ve Gizleme Anahtarları */
set {
network-name "NetWork";
default-server "irc.localhost";
services-server "services.localhost";
help-channel "#Help";
cloaking-keys { "${CLOAK_1}"; "${CLOAK_2}"; "${CLOAK_3}"; };
};
/* Günlük Kayıtları (Log) */
log {
source { local; kline; connect; disconnect; server-connect; };
destination { file "ircd.log"; };
};
EOT
# Dosya sahipliğini irc kullanıcısına ver (Eğer root olarak çalıştırılıyorsa)
if [ "$USER" = "root" ]; then
chown irc:irc "$CONF_FILE"
chmod 0600 "$CONF_FILE"
fi
echo "========================================================="
echo " unrealircd.conf Başarıyla Oluşturuldu! "
echo "========================================================="
echo "Oluşturulan Servis Link Şifresi: ${LINK_PASS}"
echo "Dosya Konumu: ${CONF_FILE}"
echo "========================================================="