Debian Codegraph @

debian/nautilus-dropbox.postinst

raw
1 #!/bin/sh
2
3 set -e
4
5 UPDATENOTIFIERDIR=/var/lib/update-notifier/user.d
6
7 case "$1" in
8 configure)
9 echo "Please restart all running instances of Nautilus, or you will experience problems. i.e. nautilus --quit"
10
11 if [ -d $UPDATENOTIFIERDIR ] ; then
12 # pgrep matches application names from /proc/<pid>/status which is
13 # truncated according to sys/procfs.h definition. Problem is it's
14 # platform dependent. Either 15 or 16 chars.
15 if pgrep -x nautilus > /dev/null 2>&1 ; then
16 cat > $UPDATENOTIFIERDIR/dropbox-restart-required <<DROPBOXEND
17 Name: Nautilus Restart Required
18 Priority: High
19 Terminal: False
20 Command: nautilus -q
21 ButtonText: _Restart Nautilus
22 DontShowAfterReboot: True
23 DisplayIf: pgrep -x nautilus -U \$(id -u) > /dev/null
24 Description: Dropbox requires Nautilus to be restarted to function properly.
25 DROPBOXEND
26 else
27 rm -f $UPDATENOTIFIERDIR/dropbox-restart-required
28 fi
29 fi
30
31 echo 'Dropbox installation successfully completed! You can start Dropbox from your applications menu.'
32
33 if [ "$2" = "" ] && [ -d $UPDATENOTIFIERDIR ] ; then
34 cat > $UPDATENOTIFIERDIR/dropbox-start-required <<DROPBOXEND
35 Name: Dropbox Start Required
36 Priority: High
37 Command: dropbox start -i
38 Terminal: False
39 DontShowAfterReboot: True
40 DisplayIf: dropbox running > /dev/null
41 Description: Start Dropbox to finish installation.
42 ButtonText: _Start Dropbox
43 DROPBOXEND
44 fi
45
46 ;;
47
48 abort-upgrade|abort-remove|abort-deconfigure)
49 ;;
50
51 *)
52 echo "postinst called with unknown argument '$1'" >&2
53 exit 1
54 ;;
55 esac
56
57 # dh_installdeb will replace this with shell code automatically
58 # generated by other debhelper scripts.
59
60 #DEBHELPER#
61
62 exit 0