Repository navigation
Expand file tree
/
Copy pathinstaller
More file actions
69 lines (55 loc) · 2.16 KB
/
Copy pathinstaller
File metadata and controls
69 lines (55 loc) · 2.16 KB
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
#!/usr/bin/env bash
set -e
if ! type "php" &> /dev/null;
then
echo 'Error: "PHP" not installed'; exit 1;
fi
if ! type "unzip" &> /dev/null;
then
echo 'Error: "unzip" not installed'; exit 1;
fi
if ! type "sed" &> /dev/null;
then
echo 'Error: "sed" not installed'; exit 1;
fi
ROOT=$(pwd)
if [ ! -z "$(ls -A $ROOT)" ];
then
echo 'Error: This script only works inside an empty directory.'; exit 1;
fi
echo 'Downloading lastest WordPress...'
cd $ROOT
wget -q https://wordpress.org/latest.zip &> /dev/null
unzip -qq latest.zip
mv wordpress/* .
rm -rf latest.zip
rm -rf wordpress
wget -q https://raw.githubusercontent.com/luizbills/create-wordpress-sqlite/main/files/wp-config.php &> /dev/null
# Download the database
# Default user is "admin" with password "pass"
mkdir -p $ROOT/wp-content/database
cd $ROOT/wp-content/database
wget -q https://raw.githubusercontent.com/luizbills/create-wordpress-sqlite/main/files/db.sqlite &> /dev/null
mv db.sqlite .ht.sqlite
echo 'Downloading SQLite Database Integration plugin...'
cd $ROOT/wp-content/plugins/
wget -q https://downloads.wordpress.org/plugin/sqlite-database-integration.zip &> /dev/null
unzip -qq sqlite-database-integration.zip
rm -rf sqlite-database-integration.zip
PLUGIN_DIR="$ROOT/wp-content/plugins/sqlite-database-integration"
cp $PLUGIN_DIR/db.copy $ROOT/wp-content/db.php
sed -i "s#{SQLITE_IMPLEMENTATION_FOLDER_PATH}#$PLUGIN_DIR#" $ROOT/wp-content/db.php
sed -i 's#{SQLITE_PLUGIN}#sqlite-database-integration/load.php#' $ROOT/wp-content/db.php
echo 'Downloading Adminer installer...'
mkdir $ROOT/adminer
cd $ROOT/adminer
wget -q https://raw.githubusercontent.com/luizbills/create-wordpress-sqlite/main/files/adminer/install.sh &> /dev/null
chmod +x $ROOT/adminer/install.sh
echo 'Finishing...'
cd $ROOT
wget -q https://raw.githubusercontent.com/luizbills/create-wordpress-sqlite/main/files/start-server.sh &> /dev/null
chmod +x $ROOT/start-server.sh
wget -q https://raw.githubusercontent.com/luizbills/create-wordpress-sqlite/main/files/server.cfg &> /dev/null
echo 'DONE!'
echo 'Run ./start-server.sh to start your WordPress server'
echo 'Optional: run ./adminer/install.sh to install and setup Adminer database editor'