The license change version 1.0 to version 1.1
[platform/framework/web/web-provider.git] / data / web_provider_reset_db.sh
1 #!/bin/sh
2 # Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
3 #
4 #    Licensed under the Flora License, Version 1.1 (the "License");
5 #    you may not use this file except in compliance with the License.
6 #    You may obtain a copy of the License at
7 #
8 #        http://floralicense.org/license/
9 #
10 #    Unless required by applicable law or agreed to in writing, software
11 #    distributed under the License is distributed on an "AS IS" BASIS,
12 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #    See the License for the specific language governing permissions and
14 #    limitations under the License.
15 #
16
17 for name in web_provider
18 do
19     rm -f /opt/dbspace/.$name.db
20     rm -f /opt/dbspace/.$name.db-journal
21     SQL="PRAGMA journal_mode = PERSIST;"
22     sqlite3 /opt/dbspace/.$name.db "$SQL"
23     SQL=".read /usr/share/web-provider/"$name"_db.sql"
24     sqlite3 /opt/dbspace/.$name.db "$SQL"
25     touch /opt/dbspace/.$name.db-journal
26     chown 0:6026 /opt/dbspace/.$name.db
27     chown 0:6026 /opt/dbspace/.$name.db-journal
28     chmod 660 /opt/dbspace/.$name.db
29     chmod 660 /opt/dbspace/.$name.db-journal
30 done