2019-11-22 18:48:53 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# make config file
|
|
|
|
if [ ! -f "/ircd/ircd.yaml" ]; then
|
2020-06-15 00:54:36 +02:00
|
|
|
awk '{gsub(/path: languages/,"path: /ircd-bin/languages")}1' /ircd-bin/default.yaml > /tmp/ircd.yaml
|
2019-11-22 18:48:53 +01:00
|
|
|
|
|
|
|
# change default oper passwd
|
|
|
|
OPERPASS=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c20)
|
2020-03-31 19:35:24 +02:00
|
|
|
echo "Oper username:password is admin:$OPERPASS"
|
2021-05-28 23:15:30 +02:00
|
|
|
ENCRYPTEDPASS=$(echo "$OPERPASS" | /ircd-bin/ergo genpasswd)
|
2020-05-25 00:00:58 +02:00
|
|
|
ORIGINALPASS='\$2a\$04\$0123456789abcdef0123456789abcdef0123456789abcdef01234'
|
2019-11-22 18:48:53 +01:00
|
|
|
|
|
|
|
awk "{gsub(/password: \\\"$ORIGINALPASS\\\"/,\"password: \\\"$ENCRYPTEDPASS\\\"\")}1" /tmp/ircd.yaml > /tmp/ircd2.yaml
|
|
|
|
|
|
|
|
unset OPERPASS
|
|
|
|
unset ENCRYPTEDPASS
|
|
|
|
unset ORIGINALPASS
|
|
|
|
|
|
|
|
mv /tmp/ircd2.yaml /ircd/ircd.yaml
|
|
|
|
fi
|
|
|
|
|
|
|
|
# make self-signed certs if they don't already exist
|
2021-05-28 23:15:30 +02:00
|
|
|
/ircd-bin/ergo mkcerts
|
2019-11-22 18:48:53 +01:00
|
|
|
|
|
|
|
# run!
|
2021-05-28 23:15:30 +02:00
|
|
|
exec /ircd-bin/ergo run
|