| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 | 2 |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # Version = @@VERSION@@ | 7 # Version = @@VERSION@@ |
| 8 | 8 |
| 9 HELPERTOOLS=/Library/PrivilegedHelperTools | 9 HELPERTOOLS=/Library/PrivilegedHelperTools |
| 10 SERVICE_NAME=org.chromium.chromoting | 10 SERVICE_NAME=org.chromium.chromoting |
| 11 CONFIG_FILE="$HELPERTOOLS/$SERVICE_NAME.json" | 11 CONFIG_FILE="$HELPERTOOLS/$SERVICE_NAME.json" |
| 12 SCRIPT_FILE="$HELPERTOOLS/$SERVICE_NAME.me2me.sh" | 12 SCRIPT_FILE="$HELPERTOOLS/$SERVICE_NAME.me2me.sh" |
| 13 USERS_TMP_FILE="$SCRIPT_FILE.users" | 13 USERS_TMP_FILE="$SCRIPT_FILE.users" |
| 14 PLIST=/Library/LaunchAgents/org.chromium.chromoting.plist | 14 PLIST=/Library/LaunchAgents/org.chromium.chromoting.plist |
| 15 PAM_CONFIG=/etc/pam.d/chrome-remote-desktop | 15 PAM_CONFIG=/etc/pam.d/chrome-remote-desktop |
| 16 ENABLED_FILE="$HELPERTOOLS/$SERVICE_NAME.me2me_enabled" | 16 ENABLED_FILE="$HELPERTOOLS/$SERVICE_NAME.me2me_enabled" |
| 17 ENABLED_FILE_BACKUP="$ENABLED_FILE.backup" | 17 ENABLED_FILE_BACKUP="$ENABLED_FILE.backup" |
| 18 LOG_FILE=/var/log/org.chromium.chromoting.log | |
| 19 | 18 |
| 20 KSADMIN=/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Content
s/MacOS/ksadmin | 19 KSADMIN=/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Content
s/MacOS/ksadmin |
| 21 KSUPDATE=https://tools.google.com/service/update2 | 20 KSUPDATE=https://tools.google.com/service/update2 |
| 22 KSPID=com.google.chrome_remote_desktop | 21 KSPID=com.google.chrome_remote_desktop |
| 23 KSPVERSION=@@VERSION@@ | 22 KSPVERSION=@@VERSION@@ |
| 24 | 23 |
| 25 function on_error { | 24 function on_error { |
| 26 logger An error occurred during Chrome Remote Desktop setup. | 25 logger An error occurred during Chrome Remote Desktop setup. |
| 27 exit 1 | 26 exit 1 |
| 28 } | 27 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 password required pam_deny.so | 66 password required pam_deny.so |
| 68 session required pam_deny.so | 67 session required pam_deny.so |
| 69 | 68 |
| 70 # This file is auto-updated by the Chrome Remote Desktop installer. | 69 # This file is auto-updated by the Chrome Remote Desktop installer. |
| 71 $CONTROL_LINE | 70 $CONTROL_LINE |
| 72 EOF | 71 EOF |
| 73 else | 72 else |
| 74 logger PAM config has local edits. Not updating. | 73 logger PAM config has local edits. Not updating. |
| 75 fi | 74 fi |
| 76 | 75 |
| 77 # Create the log file (if this isn't created ahead of time | |
| 78 # then directing output from the service there won't work). | |
| 79 # Make sure admins have write privileges (CRD users are | |
| 80 # typically admins) | |
| 81 touch "$LOG_FILE" | |
| 82 chown :admin "$LOG_FILE" | |
| 83 chmod 660 "$LOG_FILE" | |
| 84 | |
| 85 # Load the service for each user for whom the service was unloaded in the | 76 # Load the service for each user for whom the service was unloaded in the |
| 86 # preflight script (this includes the root user, in case only the login screen | 77 # preflight script (this includes the root user, in case only the login screen |
| 87 # is being remoted and this is a Keystone-triggered update). | 78 # is being remoted and this is a Keystone-triggered update). |
| 88 # Also, in case this is a fresh install, load the service for the user running | 79 # Also, in case this is a fresh install, load the service for the user running |
| 89 # the installer, so they don't have to log out and back in again. | 80 # the installer, so they don't have to log out and back in again. |
| 90 if [[ -n "$USER" && "$USER" != "root" ]]; then | 81 if [[ -n "$USER" && "$USER" != "root" ]]; then |
| 91 id -u "$USER" >> "$USERS_TMP_FILE" | 82 id -u "$USER" >> "$USERS_TMP_FILE" |
| 92 fi | 83 fi |
| 93 | 84 |
| 94 if [[ -r "$USERS_TMP_FILE" ]]; then | 85 if [[ -r "$USERS_TMP_FILE" ]]; then |
| (...skipping 11 matching lines...) Expand all Loading... |
| 106 # find the PID of a process which is running in that context. The | 97 # find the PID of a process which is running in that context. The |
| 107 # loginwindow process is a good candidate since the user (if logged in to | 98 # loginwindow process is a good candidate since the user (if logged in to |
| 108 # a session) will definitely be running it. | 99 # a session) will definitely be running it. |
| 109 pid="$(find_login_window_for_user "$uid")" | 100 pid="$(find_login_window_for_user "$uid")" |
| 110 if [[ -n "$pid" ]]; then | 101 if [[ -n "$pid" ]]; then |
| 111 launchctl bsexec "$pid" sudo -u "#$uid" launchctl load -w -S Aqua "$PLIST" | 102 launchctl bsexec "$pid" sudo -u "#$uid" launchctl load -w -S Aqua "$PLIST" |
| 112 launchctl bsexec "$pid" sudo -u "#$uid" launchctl start "$SERVICE_NAME" | 103 launchctl bsexec "$pid" sudo -u "#$uid" launchctl start "$SERVICE_NAME" |
| 113 fi | 104 fi |
| 114 done | 105 done |
| 115 fi | 106 fi |
| OLD | NEW |