Index: remoting/host/installer/linux/debian/postinst |
diff --git a/remoting/host/installer/linux/debian/postinst b/remoting/host/installer/linux/debian/postinst |
index 68b8d5892978cc68d905af716edaa5a3ea0f2577..c7c7e8ae6c99d37c538cf37a1de374815224d66c 100755 |
--- a/remoting/host/installer/linux/debian/postinst |
+++ b/remoting/host/installer/linux/debian/postinst |
@@ -1,11 +1,42 @@ |
#!/bin/bash |
+# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
set -e |
-case $1 in |
+LOGOUT_MSG=" |
+Name: Please log out to update |
+Priority: Medium |
+OnlyAdminUsers: False |
+DontShowAfterReboot: true |
+DisplayIf: /usr/lib/chrome-remote-desktop/is_me2me_desktop |
+Description: Chrome Remote Desktop has been updated. Please save your work and log out in order to apply this update. Your virtual desktop will be restarted automatically. |
+" |
+ |
+NOTIFIER_DIR="/var/lib/update-notifier/user.d" |
+VAR_DIR="/var/lib/chrome-remote-desktop" |
+HASHES_FILE="$VAR_DIR/hashes" |
+ |
+case "$1" in |
"configure") |
+ # Kill me2me host processes. The wrapper script will restart them. |
echo "Shutting down remoting hosts (they will restart automatically)..." |
killall -q remoting_me2me_host || true |
+ # If any files have changed that require the user to restart their virtual |
+ # desktops (eg, the wrapper script itself) then notify them but don't do |
+ # anything that would result in them losing state. |
+ if [ -f "$HASHES_FILE" ]; then |
+ if [ -d "$NOTIFIER_DIR" ]; then |
+ if ! md5sum --status -c "$HASHES_FILE"; then |
+ echo "Sending logout notification messages to virtual desktops." |
+ echo "$LOGOUT_MSG" > "$NOTIFIER_DIR/chrome-remote-desktop-logout" |
+ fi |
+ fi |
+ rm "$HASHES_FILE" |
+ rmdir --ignore-fail-on-non-empty "$VAR_DIR" |
+ fi |
;; |
esac |