-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
78 lines (50 loc) · 1.92 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
#!/bin/bash
set -e
# Download WordPress
if [ ! -f wp-load.php ]; then
wp core download --allow-root
fi
# Generate WordPress config
if [ ! -f wp-config.php ]; then
wp config create \
--dbname="${DATABASE}" \
--dbuser="${DB_USER}" \
--dbpass="${DB_PASSWORD}" \
--dbhost="${WORDPRESS_DB_HOST}" \
--skip-check \
--force \
--allow-root
fi
# Install WordPress
if ! $(wp core is-installed --allow-root); then
wp core install \
--url="${WORDPRESS_URL}" \
--title="${WORDPRESS_TITLE}" \
--admin_user="${WORDPRESS_ADMIN_USER}" \
--admin_password="`secret wp_password`" \
--admin_email="`secret flag1`@ctf.local" \
--allow-root
wp plugin install /root/plugins/rsvpmaker.7.8.1.zip --allow-root --activate
#wp plugin install https://downloads.wordpress.org/plugin/rsvpmaker.7.8.1.zip --activate --allow-root
fi
chown -R www-data:www-data /var/www/html/
chmod 777 /opt/update-wp
echo "www-data ALL=(root) NOPASSWD: /opt/update-wp" >> /etc/sudoers
cat << EOF
_ _ _ _
| | | | (_) | |
| | __ _| |__ _ ___ _ __ ___ __ _ __| |_ _
| | / _\` | '_ \ | / __| | '__/ _ \/ _\` |/ _\` | | | |
| |___| (_| | |_) | | \__ \ | | | __/ (_| | (_| | |_| |
\_____/\__,_|_.__/ |_|___/ |_| \___|\__,_|\__,_|\__, |
__/ |
|___/
_ _ ______
| | | | | ___|
| |_| | __ ___ _____ | |_ _ _ _ __
| _ |/ _\` \ \ / / _ \ | _| | | | '_ \
| | | | (_| |\ V / __/ | | | |_| | | | |
\_| |_/\__,_| \_/ \___| \_| \__,_|_| |_|
Challenge start here by default: http://localhost:8000
EOF
exec "$@"