Chromium Code Reviews| 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 NAME=org.chromium.chromoting | 7 NAME=org.chromium.chromoting |
| 8 CONFIG_DIR=/Library/PrivilegedHelperTools | 8 CONFIG_DIR=/Library/PrivilegedHelperTools |
| 9 HOST_EXE=$CONFIG_DIR/$NAME.me2me_host.app/Contents/MacOS/remoting_me2me_host | 9 HOST_EXE=$CONFIG_DIR/$NAME.me2me_host.app/Contents/MacOS/remoting_me2me_host |
| 10 PLIST_FILE=$CONFIG_DIR/$NAME.me2me_host.app/Contents/Info.plist | 10 PLIST_FILE=$CONFIG_DIR/$NAME.me2me_host.app/Contents/Info.plist |
| 11 ENABLED_FILE=$CONFIG_DIR/$NAME.me2me_enabled | 11 ENABLED_FILE=$CONFIG_DIR/$NAME.me2me_enabled |
| 12 CONFIG_FILE=$CONFIG_DIR/$NAME.json | 12 CONFIG_FILE=$CONFIG_DIR/$NAME.json |
| 13 PREF_PANE_BUNDLE=/Library/PreferencePanes/$NAME.prefPane | |
| 13 | 14 |
| 14 # The exit code returned by 'wait' when a process is terminated by SIGTERM. | 15 # The exit code returned by 'wait' when a process is terminated by SIGTERM. |
| 15 SIGTERM_EXIT_CODE=143 | 16 SIGTERM_EXIT_CODE=143 |
| 16 | 17 |
| 17 # Range of exit codes returned by the host to indicate that a permanent error | 18 # Range of exit codes returned by the host to indicate that a permanent error |
| 18 # has occurred and that the host should not be restarted. Please, keep these | 19 # has occurred and that the host should not be restarted. Please, keep these |
| 19 # constants in sync with remoting/host/constants.h. | 20 # constants in sync with remoting/host/constants.h. |
| 20 MIN_PERMANENT_ERROR_EXIT_CODE=2 | 21 MIN_PERMANENT_ERROR_EXIT_CODE=2 |
| 21 MAX_PERMANENT_ERROR_EXIT_CODE=4 | 22 MAX_PERMANENT_ERROR_EXIT_CODE=4 |
| 22 | 23 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 rm -f "$ENABLED_FILE" | 79 rm -f "$ENABLED_FILE" |
| 79 elif [[ "$1" = "--enable" ]]; then | 80 elif [[ "$1" = "--enable" ]]; then |
| 80 echo $$ | 81 echo $$ |
| 81 cat > "$CONFIG_FILE" | 82 cat > "$CONFIG_FILE" |
| 82 touch "$ENABLED_FILE" | 83 touch "$ENABLED_FILE" |
| 83 elif [[ "$1" = "--save-config" ]]; then | 84 elif [[ "$1" = "--save-config" ]]; then |
| 84 echo $$ | 85 echo $$ |
| 85 cat > "$CONFIG_FILE" | 86 cat > "$CONFIG_FILE" |
| 86 elif [[ "$1" = "--host-version" ]]; then | 87 elif [[ "$1" = "--host-version" ]]; then |
| 87 PlistBuddy -c "Print CFBundleVersion" "$PLIST_FILE" | 88 PlistBuddy -c "Print CFBundleVersion" "$PLIST_FILE" |
| 89 elif [[ "$1" = "--launch-prefpane" ]]; then | |
|
Jamie
2012/05/23 01:17:17
Nit: relaunch-prefpane?
Lambros
2012/05/24 00:54:50
Done.
| |
| 90 # Wait for the parent (System Preferences applet) to die, by reading from | |
| 91 # stdin until the pipe is broken. | |
| 92 cat | |
|
Jamie
2012/05/23 01:17:17
Yuck :(
Also, we don't currently use "set -e" in
Lambros
2012/05/24 00:54:50
Done.
| |
| 93 open "$PREF_PANE_BUNDLE" | |
| 88 elif [[ "$1" = "--run-from-launchd" ]]; then | 94 elif [[ "$1" = "--run-from-launchd" ]]; then |
| 89 run_host | 95 run_host |
| 90 else | 96 else |
| 91 echo $$ | 97 echo $$ |
| 92 exit 1 | 98 exit 1 |
| 93 fi | 99 fi |
| OLD | NEW |