Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: src/scripts/set_shared_user_password.sh

Issue 1736025: Added restart_in_chroot_if_needed to common.sh. (Closed) Base URL: http://src.chromium.org/git/chromiumos.git
Patch Set: Reverted mod_image_for_test.sh and removed line from common.sh. Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/scripts/run_tests.sh ('k') | src/scripts/start_devserver » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2009 The Chromium OS 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 # Script to set the password for the shared user account. Stores the 7 # Script to set the password for the shared user account. Stores the
8 # MD5crypt'd password to a file, for use by customize_rootfs.sh. 8 # MD5crypt'd password to a file, for use by customize_rootfs.sh.
9 9
10 # Load common constants. This should be the first executable line. 10 # Load common constants. This should be the first executable line.
11 # The path to common.sh should be relative to your script's location. 11 # The path to common.sh should be relative to your script's location.
12 . "$(dirname "$0")/common.sh" 12 . "$(dirname "$0")/common.sh"
13 13
14 # Script must be run inside the chroot 14 # Script must be run inside the chroot
15 assert_inside_chroot 15 restart_in_chroot_if_needed $*
16 16
17 FLAGS_HELP="USAGE: $0 [flags]" 17 FLAGS_HELP="USAGE: $0 [flags]"
18 18
19 # Parse command line 19 # Parse command line
20 FLAGS "$@" || exit 1 20 FLAGS "$@" || exit 1
21 eval set -- "${FLAGS_ARGV}" 21 eval set -- "${FLAGS_ARGV}"
22 22
23 # Die on any errors. 23 # Die on any errors.
24 set -e 24 set -e
25 25
26 # Get password 26 # Get password
27 read -p "Enter password for shared user account: " PASSWORD 27 read -p "Enter password for shared user account: " PASSWORD
28 28
29 CRYPTED_PASSWD_FILE=$SCRIPTS_DIR/shared_user_passwd.txt 29 CRYPTED_PASSWD_FILE=$SCRIPTS_DIR/shared_user_passwd.txt
30 CRYPTED_PASSWD="$(echo "$PASSWORD" | openssl passwd -1 -stdin)" 30 CRYPTED_PASSWD="$(echo "$PASSWORD" | openssl passwd -1 -stdin)"
31 PASSWORD="gone now" 31 PASSWORD="gone now"
32 32
33 echo "$CRYPTED_PASSWD" > $CRYPTED_PASSWD_FILE 33 echo "$CRYPTED_PASSWD" > $CRYPTED_PASSWD_FILE
34 34
35 echo "Shared user password set in $CRYPTED_PASSWD_FILE" 35 echo "Shared user password set in $CRYPTED_PASSWD_FILE"
OLDNEW
« no previous file with comments | « src/scripts/run_tests.sh ('k') | src/scripts/start_devserver » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698