File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 4545 echo -e " DB_DSN=mysql:host=localhost;dbname=$dataname \nDB_USERNAME=$username \nDB_PASSWORD=$password " > .env
4646elif [ $database == " 2" ]
4747then
48- echo -e " DB_DSN=sqlite:$path /$dataname .sqlite\nDB_USERNAME=$username \nDB_PASSWORD=$password " > .env
49- touch $dataname .sqlite
50- echo " Needing sudo password to chown database file"
51- sudo chown www-data:www-data $dataname .sqlite
48+ mkdir -p db
49+ echo -e " DB_DSN=sqlite:$path /db/$dataname .sqlite\nDB_USERNAME=$username \nDB_PASSWORD=$password " > .env
50+ if [ -f db/$dataname .sqlite ]; then
51+ echo " Database file already exists at $dataname .sqlite, if this is unexpected you might have to delete it manually and run this script again"
52+ else
53+ touch db/$dataname .sqlite
54+ fi
55+ echo " Needing sudo password to chown database files"
56+ sudo chown -R www-data:www-data db
5257fi
5358
5459# Run php script
@@ -57,5 +62,5 @@ echo "Running migration script"
5762php bin/migrate
5863
5964echo " "
60- echo " Creating admin user"
65+ echo " Creating admin user, please fill the following data with the administrator credentials "
6166php bin/adduser
You can’t perform that action at this time.
0 commit comments