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