Skip to content

Commit 7bb36ce

Browse files
committed
Update script
1 parent c5c9b05 commit 7bb36ce

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

setup.sh

100644100755
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ then
4545
echo -e "DB_DSN=mysql:host=localhost;dbname=$dataname\nDB_USERNAME=$username\nDB_PASSWORD=$password" > .env
4646
elif [ $database == "2" ]
4747
then
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
48+
echo -e "DB_DSN=sqlite:$path/$dataname.sqlite\nDB_USERNAME=$username\nDB_PASSWORD=$password" > .env
49+
if [ -f $dataname.sqlite ]; then
5150
echo "Database file already exists at $dataname.sqlite, if this is unexpected you might have to delete it manually and run this script again"
5251
else
53-
touch db/$dataname.sqlite
52+
touch $dataname.sqlite
5453
fi
55-
echo "Needing sudo password to chown database files"
56-
sudo chown -R www-data:www-data db
54+
echo "Needing sudo password to give permission to database file"
55+
sudo chmod 775 $dataname.sqlite
56+
sudo chown www-data:www-data $dataname.sqlite
5757
fi
5858

5959
# Run php script

0 commit comments

Comments
 (0)