-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
82 lines (73 loc) · 2.34 KB
/
entrypoint.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env bash
echo 'Updating the index.html file ...'
echo ''
# Page title
if [[ -z "$TITLE" ]]
then
echo "WARNING: No TITLE given, using the default one"
TITLE='Coming soon ...'
fi;
echo "Updating title to $TITLE ..."
sed -i "s/ENV_TITLE/$TITLE/" "$BASE_DIR/index.html"
# Product name
if [[ -z "$PRODUCT_NAME" ]]
then
echo "WARNING: No PRODUCT_NAME given, using the default one"
PRODUCT_NAME='Coming Soon'
fi;
echo "Updating the product name with $PRODUCT_NAME ..."
sed -i "s/ENV_PRODUCT_NAME/$PRODUCT_NAME/" "$BASE_DIR/index.html"
# Catchy phrase
if [[ -z "$NOTICE_TEXT" ]]
then
echo "WARNING: No NOTICE_TEXT given, using the default one"
NOTICE_TEXT=''
fi;
echo "Updating the catchy phrase with $NOTICE_TEXT ..."
sed -i "s/ENV_NOTICE_TEXT/$NOTICE_TEXT/" "$BASE_DIR/index.html"
# Facebook button
if [[ -z "$FACEBOOK_URL" ]]
then
echo "WARNING: No Facebook URL given, removing the button."
FACEBOOK_BUTTON=''
echo "Removing the Facebook button ..."
else
FACEBOOK_BUTTON="<li><a href=\"$FACEBOOK_URL\"><i class=\"fa fa-facebook-square\"></i> Share</a></li>"
echo "Updating the Facebook button ..."
fi;
sed -i "s~ENV_FACEBOOK_BUTTON~$FACEBOOK_BUTTON~" "$BASE_DIR/index.html"
# Twitter button
if [[ -z "$TWITTER_URL" ]]
then
echo "WARNING: No Twitter URL given, removing the button."
TWITTER_BUTTON=''
echo "Removing the Twitter button ..."
else
TWITTER_BUTTON="<li><a href=\"$TWITTER_URL\"><i class=\"fa fa-twitter\"></i> Tweet</a></li>"
echo "Updating the Twitter button ..."
fi;
sed -i "s~ENV_TWITTER_BUTTON~$TWITTER_BUTTON~" "$BASE_DIR/index.html"
# Github button
if [[ -z "$GITHUB_URL" ]]
then
echo "WARNING: No Github URL given, removing the button."
GITHUB_BUTTON=''
echo "Removing the Github button ..."
else
GITHUB_BUTTON="<li><a href=\"$GITHUB_URL\"><i class=\"fa fa-github\"></i> Follow</a></li>"
echo "Updating the Github button ..."
fi;
sed -i "s~ENV_GITHUB_BUTTON~$GITHUB_BUTTON~" "$BASE_DIR/index.html"
# Email button
if [[ -z "$EMAIL" ]]
then
echo "WARNING: No Email address given, removing the button."
EMAIL_BUTTON=''
echo "Remving the Email button ..."
else
EMAIL_BUTTON="<li><a href=\"mailto:$EMAIL\"><i class=\"fa fa-envelope-o\"></i> Email</a></li>"
echo "Updating the Email button ..."
fi;
sed -i "s~ENV_EMAIL_BUTTON~$EMAIL_BUTTON~" "$BASE_DIR/index.html"
echo "Starting Nginx ..."
nginx -g "daemon off;"