mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-22 11:59:40 +01:00
68a8f4b698
This will allow easier building on docker hub and let us automatically publish tags for each release. Fixes oragono/oragono-docker#20
30 lines
850 B
Bash
30 lines
850 B
Bash
#!/bin/sh
|
|
|
|
# start in right dir
|
|
cd /ircd
|
|
|
|
# make config file
|
|
if [ ! -f "/ircd/ircd.yaml" ]; then
|
|
awk '{gsub(/path: languages/,"path: /ircd-bin/languages")}1' /ircd-bin/oragono.yaml > /tmp/ircd.yaml
|
|
|
|
# change default oper passwd
|
|
OPERPASS=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c20)
|
|
echo "Oper username:password is dan:$OPERPASS"
|
|
ENCRYPTEDPASS=$(echo "$OPERPASS" | /ircd-bin/oragono genpasswd)
|
|
ORIGINALPASS='\$2a\$04\$LiytCxaY0lI.guDj2pBN4eLRD5cdM2OLDwqmGAgB6M2OPirbF5Jcu'
|
|
|
|
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
|
|
/ircd-bin/oragono mkcerts
|
|
|
|
# run!
|
|
exec /ircd-bin/oragono run
|