Index: src/scripts/enable_localaccount.sh |
diff --git a/src/scripts/enable_localaccount.sh b/src/scripts/enable_localaccount.sh |
index fc87d82b9a02039b6929f7b3fa8cd6e6edeeebc0..802d4ee348ec7540aac63fc148ef9691a0d77bbb 100755 |
--- a/src/scripts/enable_localaccount.sh |
+++ b/src/scripts/enable_localaccount.sh |
@@ -1,5 +1,7 @@ |
#!/bin/bash |
- |
+# Copyright (c) 2010 The Chromium OS 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 |
if [ -z $1 ] |
@@ -9,33 +11,26 @@ then |
fi |
echo "Enabling local account $1@gmail.com." |
-echo "Remove ../platform/pam_google/pam_localaccount.h and " |
-echo "../platform/pam_offline/pam_localaccount.h to disable." |
- |
-cat <<EOF > ../platform/pam_google/pam_localaccount.h |
-// local username for Chrome OS pam |
-// This file is auto-generated by enable_localaccount.sh |
+echo "Remove these files to disable:" |
-#ifndef CHROMEOS_PAM_LOCALACCOUNT_H_ |
-#define CHROMEOS_PAM_LOCALACCOUNT_H_ |
+for namespace in pam_google pam_offline |
+do |
+ file=../platform/$namespace/pam_localaccount.h |
+ [ "$namespace" = pam_google ] && namespace=chromeos_pam |
-namespace chromeos_pam { |
-const char kLocalAccount[] = "$1@gmail.com"; |
-} |
- |
-#endif // CHROMEOS_PAM_LOCALACCOUNT_H_ |
-EOF |
+ echo $file |
-cat <<EOF > ../platform/pam_offline/pam_localaccount.h |
+ cat <<EOF > $file |
// local username for Chrome OS pam |
// This file is auto-generated by enable_localaccount.sh |
#ifndef CHROMEOS_PAM_LOCALACCOUNT_H_ |
#define CHROMEOS_PAM_LOCALACCOUNT_H_ |
-namespace pam_offline { |
+namespace $namespace { |
const char kLocalAccount[] = "$1@gmail.com"; |
} |
#endif // CHROMEOS_PAM_LOCALACCOUNT_H_ |
EOF |
+done |