-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-console
More file actions
executable file
·52 lines (43 loc) · 1.15 KB
/
install-console
File metadata and controls
executable file
·52 lines (43 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
GUI_VERSION="0"
NEW_VERSION="1"
PLAYBOOK="xsce-base.yml"
INVENTORY="ansible_hosts"
# copy var files to /etc/xsce for subsequent use
# if not the first run, repo location is here
if [ -f /etc/xsce/xsce.env ]
then
. /etc/xsce/xsce.env
NEW_VERSION=`cat $XSCE_DIR/roles/1-prep/defaults/main.yml | grep new_gui_version | awk -F ": " '{print $2}'`
cd $XSCE_DIR
fi
./install-init
./install-menu
if [ -f /etc/xsce/config_vars.yml ] && [ "$GUI_VERSION" == "$NEW_VERSION" ]
then
echo "install-console is latest version exiting"
exit 0
fi
SELINUX_BEFORE=""
SELINUX_AFTER=""
if [ ! -f $PLAYBOOK ]
then
echo "XSCE Playbook not found."
echo "Please run this command from the top level of the git repo."
echo "Exiting."
exit 1
fi
if [ -f /etc/selinux/config ]
then
SELINUX_BEFORE=`cat /etc/selinux/config | gawk -F= '/^SELINUX=/{ print $2 }'`
fi
export ANSIBLE_LOG_PATH="$XSCE_DIR/xsce-install.log"
ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local
if [ -f /etc/selinux/config ]
then
SELINUX_AFTER=`cat /etc/selinux/config | gawk -F= '/^SELINUX=/{ print $2 }'`
fi
if [ "$SELINUX_BEFORE" != "$SELINUX_AFTER" ]; then
echo "Rebooting ..."
reboot
fi