Set also the call state when changing the device mode (NB#160319)
[hildon-application-manager:kalfa-ham.git] / hildon-application-manager.sh
1 #!/bin/sh
2 #
3 # osso-backup restore.d script.
4 #
5 # We merge the restored catalogues right here and copy the list of
6 # packages to a place where the AM can find them.
7
8 if [ ! -e $1 ]
9 then
10   exit 0
11 fi
12
13 cats="/var/lib/hildon-application-manager/catalogues.backup"
14 cats2="/var/lib/hildon-application-manager/catalogues2.backup"
15 pkgs="/var/lib/hildon-application-manager/packages.backup"
16 upkgs="$HOME/.hildon-application-manager/packages.backup"
17
18 if grep -q "$cats" "$1"
19 then
20   sudo /usr/bin/hildon-application-manager-util restore-catalogues
21 elif grep -q "$cats2" "$1"
22 then
23   sudo /usr/bin/hildon-application-manager-util restore-catalogues2
24 fi
25
26 if [ ! -d $HOME/.hildon-application-manager ]; then
27   mkdir $HOME/.hildon-application-manager
28 fi
29
30 if [ -f $pkgs ]; then
31   cp "$pkgs" "$upkgs"
32 else
33   rm -f "$upkgs"
34 fi
35
36 exit 0