source: main/trunk/greenstone3/src/ansible-playbooks/_local_config.bash@ 38659

Last change on this file since 38659 was 38653, checked in by davidb, 5 months ago

Changes after testing on Redhat 8

File size: 1.5 KB
Line 
1
2if [ $# -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
10fi
11
12localhost_username=${1:-greenstone}
13shift
14
15ap_extra_args=""
16echo ""
17echo "####"
18echo "# Checking to see if user can 'sudo' without password"
19
20if sudo -n true 2>/dev/null; then
21 echo "# => yes"
22else
23 echo "# => no"
24 ap_extra_args="$ap_extra_args --ask-become-pass"
25fi
26
27echo "####"
28echo ""
29
30
31echo ""
32echo "####"
33echo "# Away to run the playbook with {{ gsdl3_user }}:"
34echo "# $localhost_username"
35##echo "# Setting the username to install Greenstone3 as to:"
36##echo "# $localhost_username"
37echo "####"
38echo ""
39
40if [ ! -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
50fi
51
52echo ""
53echo "Continuing in 5 seconds ..."
54echo "[press <enter> to proceed immediately, or 'q' or ^C to quit]"
55read -t 5 continue_answer
56
57if [ $? == 0 ] ; then
58 # keyboard input given
59
60 if [ "x$continue_answer" == "xq" ] ; then
61 exit 1
62 fi
63fi
64
65
66
67
Note: See TracBrowser for help on using the repository browser.