mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 06:31:18 +02:00
Re-use .h code for both files. Add a license header.
Review URL: http://codereview.chromium.org/594006
This commit is contained in:
parent
d00425ef50
commit
b6fb706f38
@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/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
|
set -e
|
||||||
|
|
||||||
if [ -z $1 ]
|
if [ -z $1 ]
|
||||||
@ -9,33 +11,26 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Enabling local account $1@gmail.com."
|
echo "Enabling local account $1@gmail.com."
|
||||||
echo "Remove ../platform/pam_google/pam_localaccount.h and "
|
echo "Remove these files to disable:"
|
||||||
echo "../platform/pam_offline/pam_localaccount.h to disable."
|
|
||||||
|
|
||||||
cat <<EOF > ../platform/pam_google/pam_localaccount.h
|
for namespace in pam_google pam_offline
|
||||||
|
do
|
||||||
|
file=../platform/$namespace/pam_localaccount.h
|
||||||
|
[ "$namespace" = pam_google ] && namespace=chromeos_pam
|
||||||
|
|
||||||
|
echo $file
|
||||||
|
|
||||||
|
cat <<EOF > $file
|
||||||
// local username for Chrome OS pam
|
// local username for Chrome OS pam
|
||||||
// This file is auto-generated by enable_localaccount.sh
|
// This file is auto-generated by enable_localaccount.sh
|
||||||
|
|
||||||
#ifndef CHROMEOS_PAM_LOCALACCOUNT_H_
|
#ifndef CHROMEOS_PAM_LOCALACCOUNT_H_
|
||||||
#define CHROMEOS_PAM_LOCALACCOUNT_H_
|
#define CHROMEOS_PAM_LOCALACCOUNT_H_
|
||||||
|
|
||||||
namespace chromeos_pam {
|
namespace $namespace {
|
||||||
const char kLocalAccount[] = "$1@gmail.com";
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // CHROMEOS_PAM_LOCALACCOUNT_H_
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat <<EOF > ../platform/pam_offline/pam_localaccount.h
|
|
||||||
// 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 {
|
|
||||||
const char kLocalAccount[] = "$1@gmail.com";
|
const char kLocalAccount[] = "$1@gmail.com";
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // CHROMEOS_PAM_LOCALACCOUNT_H_
|
#endif // CHROMEOS_PAM_LOCALACCOUNT_H_
|
||||||
EOF
|
EOF
|
||||||
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user