| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# make config file |
| 4 |
if [ ! -f "/ircd/ircd.yaml" ]; then |
| 5 |
awk '{gsub(/path: languages/,"path: /ircd-bin/languages")}1' /ircd-bin/default.yaml > /tmp/ircd.yaml |
| 6 |
|
| 7 |
# change default oper passwd |
| 8 |
OPERPASS=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c20) |
| 9 |
echo "Oper username:password is admin:$OPERPASS" |
| 10 |
ENCRYPTEDPASS=$(echo "$OPERPASS" | /ircd-bin/ergo genpasswd) |
| 11 |
ORIGINALPASS='\$2a\$04\$0123456789abcdef0123456789abcdef0123456789abcdef01234' |
| 12 |
|
| 13 |
awk "{gsub(/password: \\\"$ORIGINALPASS\\\"/,\"password: \\\"$ENCRYPTEDPASS\\\"\")}1" /tmp/ircd.yaml > /tmp/ircd2.yaml |
| 14 |
|
| 15 |
unset OPERPASS |
| 16 |
unset ENCRYPTEDPASS |
| 17 |
unset ORIGINALPASS |
| 18 |
|
| 19 |
mv /tmp/ircd2.yaml /ircd/ircd.yaml |
| 20 |
fi |
| 21 |
|
| 22 |
# make self-signed certs if they don't already exist |
| 23 |
/ircd-bin/ergo mkcerts |
| 24 |
|
| 25 |
# run! |
| 26 |
exec /ircd-bin/ergo run |