Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 set -e | 5 set -e |
| 6 | 6 |
| 7 if [ -z $1 ] | 7 if [ -z $1 ] |
| 8 then | 8 then |
| 9 echo "Usage: $0 localaccount_username" | 9 echo "Usage: $0 localaccount_username" |
| 10 exit 1 | 10 exit 1 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 #ifndef CHROMEOS_PAM_LOCALACCOUNT_H_ | 27 #ifndef CHROMEOS_PAM_LOCALACCOUNT_H_ |
| 28 #define CHROMEOS_PAM_LOCALACCOUNT_H_ | 28 #define CHROMEOS_PAM_LOCALACCOUNT_H_ |
| 29 | 29 |
| 30 namespace $namespace { | 30 namespace $namespace { |
| 31 const char kLocalAccount[] = "$1@gmail.com"; | 31 const char kLocalAccount[] = "$1@gmail.com"; |
| 32 } | 32 } |
| 33 | 33 |
| 34 #endif // CHROMEOS_PAM_LOCALACCOUNT_H_ | 34 #endif // CHROMEOS_PAM_LOCALACCOUNT_H_ |
| 35 EOF | 35 EOF |
| 36 done | 36 done |
| 37 | |
| 38 VAR_NAME=CHROMEOS_LOCAL_ACCOUNT | |
|
Chris Masone
2010/03/01 23:15:02
Maybe a comment here to explain what's going on?
| |
| 39 if grep -q ${VAR_NAME} /etc/make.conf.user; then | |
| 40 regex="s/${VAR_NAME}=.*/${VAR_NAME}=$1@gmail.com/" | |
| 41 sudo sed -i -e "${regex}" /etc/make.conf.user | |
| 42 else | |
| 43 sudo sh -c "echo ""${VAR_NAME}=$1@gmail.com"" >> /etc/make.conf.user" | |
| 44 fi | |
| OLD | NEW |