forked from SleepyMario/phantombot-docker
-
Notifications
You must be signed in to change notification settings - Fork 4
/
wrapper.sh
65 lines (57 loc) · 1.84 KB
/
wrapper.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
# script originally from https://github.com/aldovc/phantombot and then modified for additional options
export BOTLOGIN=/phantombot/config/botlogin.txt
function setProp {
local prop=$1
local var=${2}
if [ -n "$var" ]; then
# normalize booleans
case ${var^^} in
TRUE|FALSE)
var=${var,,} ;;
esac
echo "Setting ${prop} to '${var}' in ${BOTLOGIN}"
echo "${prop}=${var}" >> ${BOTLOGIN}
else
echo "Skip setting ${prop}"
fi
}
setProp "apioauth" "$APIOAUTH"
setProp "baseport" "$BASEPORT"
setProp "channel" "$CHANNEL"
setProp "clientid" "$CLIENTID"
setProp "musicenable" "$MUSICENABLE"
setProp "oauth" "$OAUTH"
setProp "owner" "$OWNER"
setProp "panelpassword" "$PANELPASSWORD"
setProp "paneluser" "$PANELUSER"
setProp "twitchalertskey" "$TWITCHALERTSKEY"
setProp "twitchalertslimit" "$TWITCHALERTSLIMIT"
setProp "twitterUser" "$TWITTERUSER"
setProp "twitter_access_token" "$TWITTER_ACCESS_TOKEN"
setProp "twitter_consumer_key" "$TWITTER_CONSUMER_KEY"
setProp "twitter_consumer_secret" "$TWITTER_CONSUMER_SECRET"
setProp "twitter_secret_token" "$TWITTER_SECRET_TOKEN"
setProp "webauth" "$WEBAUTH"
setProp "webauthro" "$WEBAUTHRO"
setProp "webenable" "$WEBENABLE"
setProp "user" "$USER"
setProp "devcommands" "$DEVCOMMANDS"
setProp "datastore" "$DATASTORE"
setProp "mysqlhost" "$MYSQLHOST"
setProp "mysqlname" "$MYSQLNAME"
setProp "mysqlpass" "$MYSQLPASS"
setProp "mysqlport" "$MYSQLPORT"
setProp "mysqluser" "$MYSQLUSER"
setProp "youtubekey" "$YOUTUBEKEY"
setProp "ytauth" "$YTAUTH"
setProp "discord_token" "$DISCORD_TOKEN"
setProp "twitch_tcp_nodelay" "$TWITCH_TCP_NODELAY"
setProp "msglimit30" "$MSGLIMIT30"
setProp "usehttps" "$USEHTTPS"
setProp "whisperlimit60" "$WHISPERLIMIT60"
setProp "ytauthro" "$YTAUTHRO"
echo "Done setting variables..."
echo $USER
echo "Launching bot..."
cd /phantombot && ./launch-service.sh -D