Line | |
---|
1 |
|
---|
2 | if [ $# -gt 1 ] || [ "x$1" == "x-help" ] || [ "x$1" == "x--help" ] ; then
|
---|
3 | echo "" >&2
|
---|
4 | echo "Usage: $0 localhost-username" >&2
|
---|
5 | echo "" >&2
|
---|
6 | echo "For example:" >&2
|
---|
7 | echo " $0 greenstone" >&2
|
---|
8 | echo "" >&2
|
---|
9 | exit 1
|
---|
10 | fi
|
---|
11 |
|
---|
12 | localhost_username=${1:-greenstone}
|
---|
13 | shift
|
---|
14 |
|
---|
15 | ap_extra_args=""
|
---|
16 | echo ""
|
---|
17 | echo "####"
|
---|
18 | echo "# Checking to see if user can 'sudo' without password"
|
---|
19 |
|
---|
20 | if sudo -n true 2>/dev/null; then
|
---|
21 | echo "# => yes"
|
---|
22 | else
|
---|
23 | echo "# => no"
|
---|
24 | ap_extra_args="$ap_extra_args --ask-become-pass"
|
---|
25 | fi
|
---|
26 |
|
---|
27 | echo "####"
|
---|
28 | echo ""
|
---|
29 |
|
---|
30 |
|
---|
31 | echo ""
|
---|
32 | echo "####"
|
---|
33 | echo "# Away to run the playbook with {{ gsdl3_user }}:"
|
---|
34 | echo "# $localhost_username"
|
---|
35 | ##echo "# Setting the username to install Greenstone3 as to:"
|
---|
36 | ##echo "# $localhost_username"
|
---|
37 | echo "####"
|
---|
38 | echo ""
|
---|
39 |
|
---|
40 | if [ ! -d "/home/$localhost_username" ] ; then
|
---|
41 |
|
---|
42 | echo "! Warning: Failed to detect /home/$localhost_username as a home directory" >&2
|
---|
43 | echo "! " >&2
|
---|
44 | echo "! Note: You can control the username used by providing it as a command-line argument" >&2
|
---|
45 | echo "! when the ansible playbook is run." >&2
|
---|
46 | echo "! " >&2
|
---|
47 | echo "! Or alternatively: consider using 'sudo adduser' (or similar) to create an account" >&2
|
---|
48 | echo "! for the missing user" >&2
|
---|
49 | echo "" >&2
|
---|
50 | fi
|
---|
51 |
|
---|
52 | echo ""
|
---|
53 | echo "Continuing in 5 seconds ..."
|
---|
54 | echo "[press <enter> to proceed immediately, or 'q' or ^C to quit]"
|
---|
55 | read -t 5 continue_answer
|
---|
56 |
|
---|
57 | if [ $? == 0 ] ; then
|
---|
58 | # keyboard input given
|
---|
59 |
|
---|
60 | if [ "x$continue_answer" == "xq" ] ; then
|
---|
61 | exit 1
|
---|
62 | fi
|
---|
63 | fi
|
---|
64 |
|
---|
65 |
|
---|
66 |
|
---|
67 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.