Update User Agent String
[framework/web/wrt-commons.git] / etc / wrt_commons_reset_db.sh
1 #!/bin/sh
2 # Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 #
4 #    Licensed under the Apache License, Version 2.0 (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://www.apache.org/licenses/LICENSE-2.0
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 rm -rf /opt/apps/widget/system/*
18
19 #Removing of widget desktop icons
20 WIDGET_EXEC_PATH=/opt/apps/
21 WIDGET_DESKTOP_PATH=/opt/share/applications/
22 WRT_DB=/opt/dbspace/.wrt.db
23 PLUGINS_INSTALLATION_REQUIRED_PATH=/opt/apps/widget/
24 PLUGINS_INSTALLATION_REQUIRED=plugin-installation-required
25
26 if [ -f ${WRT_DB} ]
27 then
28     PKG_NAME_SET=$(sqlite3 $WRT_DB 'select pkgname from WidgetInfo;')
29     for pkgname in $PKG_NAME_SET
30     do
31         rm -rf ${WIDGET_EXEC_PATH}${pkgname}
32         widget_desktop_file="${WIDGET_DESKTOP_PATH}${pkgname}.desktop";
33         if [ -f ${widget_desktop_file} ]; then
34             rm -f $widget_desktop_file;
35         fi
36     done
37 else
38     echo "${WRT_DB} doesn't exist"
39 fi
40
41 wrt_commons_create_clean_db.sh
42 if [ -e ${PLUGINS_INSTALLATION_REQUIRED_PATH} ] && [ -d ${PLUGINS_INSTALLATION_REQUIRED_PATH} ]
43 then
44     touch ${PLUGINS_INSTALLATION_REQUIRED_PATH}${PLUGINS_INSTALLATION_REQUIRED}
45 fi