|
34 | 34 | esac |
35 | 35 | done |
36 | 36 |
|
37 | | -if [ 0 -eq 1 ]; then |
38 | | -typeset hostvm_type=undef |
39 | | -info "Select hypervisor :" |
40 | | -info " 1 : vbox for linux" |
41 | | -while [ 0 -eq 0 ] # forever |
42 | | -do |
43 | | - read -s -n 1 keyboard |
44 | | - case $keyboard in |
45 | | - 1) LN |
46 | | - info "==> VirtualBox for Linux" |
47 | | - hostvm_type=linux_virtualbox |
48 | | - full_linux_iso_n="$HOME/ISO/oracle_linux_7/V100082-01.iso" |
49 | | - break |
50 | | - ;; |
| 37 | +typeset -r hostvm_type=linux_virtualbox |
51 | 38 |
|
52 | | - *) error "$keyboard invalid." |
53 | | - ;; |
54 | | - esac |
55 | | -done |
56 | | -LN |
57 | | -else |
58 | | - hostvm_type=linux_virtualbox |
59 | | - full_linux_iso_n="$HOME/ISO/oracle_linux_7/V100082-01.iso" |
60 | | -fi # [ 0 -eq 1 ]; then |
| 39 | +# ============================================================================ |
| 40 | +# Pré sélection de l'image Oracle Linux 7 |
| 41 | +typeset -r OracleLinux72=V100082-01.iso |
| 42 | +typeset -r OracleLinux73=V834394-01.iso |
| 43 | + |
| 44 | +full_linux_iso_n="$HOME/ISO/oracle_linux_7/$OracleLinux72" |
| 45 | +OL7_LABEL_n=7.2 |
| 46 | + |
| 47 | +if [ 0 -eq 1 ]; then |
| 48 | +# Oracle Linux 7.3 ne fonctionne pas du tout, java par en core dump plus autre |
| 49 | +# joyeusetées. |
| 50 | +full_linux_iso_n="$HOME/ISO/oracle_linux_7/$OracleLinux73" |
| 51 | +OL7_LABEL_n=7.3 |
| 52 | +fi |
| 53 | +# ============================================================================ |
61 | 54 |
|
62 | 55 | # $1 nom de la variable à renseigner |
63 | 56 | # $2 Message à afficher |
@@ -98,14 +91,16 @@ function read_dns_main_ip |
98 | 91 | test_if_cmd_exists VBoxManage |
99 | 92 | if [ $? -eq 0 ] |
100 | 93 | then |
101 | | - vm_p="$(VBoxManage list systemproperties | grep "Default machine folder:" | tr -s [:space:] | cut -d' ' -f4-)" |
| 94 | + vm_p="$(VBoxManage list systemproperties |\ |
| 95 | + grep "Default machine folder:" |\ |
| 96 | + tr -s [:space:] | cut -d' ' -f4-)" |
102 | 97 | ask_for_variable vm_p "VMs folder :" |
103 | 98 | else |
104 | 99 | error "VirtualBox not installed or VBoxManage not in PATH" |
105 | 100 | LN |
106 | 101 | fi |
107 | 102 |
|
108 | | -ask_for_variable full_linux_iso_n "Full path for Oracle Linux 7 ISO (...V100082-01.iso) :" |
| 103 | +ask_for_variable full_linux_iso_n "Full path for Oracle Linux $OL7_LABEL_n ISO $OracleLinux72 :" |
109 | 104 |
|
110 | 105 | dns_main_n=$(read_dns_main_ip) |
111 | 106 | ask_for_variable dns_main_n "Main DNS/box IP :" |
|
127 | 122 | exec_cmd "sed -i 's~vm_path=.*$~vm_path=\"$vm_p\"~g' ~/plescripts/global.cfg" |
128 | 123 | LN |
129 | 124 |
|
| 125 | +if [ "$HOME/ISO/oracle_linux_7/$OracleLinux73" == "$full_linux_iso_n" ] |
| 126 | +then |
| 127 | + OL7_LABEL_n=7.3 |
| 128 | + line_separator |
| 129 | + error "Oracle Linux $OL7_LABEL_n don't work." |
| 130 | + error "Latest tested Release is Oracle Linux 7.2 ISO : $OracleLinux72" |
| 131 | + LN |
| 132 | + exit 1 |
| 133 | +else |
| 134 | + OL7_LABEL_n=7.2 |
| 135 | +fi |
| 136 | + |
| 137 | +info "Setup Oracle Linux $OL7_LABEL_n" |
130 | 138 | iso_path=${full_linux_iso_n%/*} |
131 | 139 | iso_name=${full_linux_iso_n##*/} |
| 140 | +exec_cmd "sed -i 's/OL7_LABEL=.*/OL7_LABEL=$OL7_LABEL_n/g' ~/plescripts/global.cfg" |
132 | 141 | exec_cmd "sed -i 's~iso_olinux_path=.*$~iso_olinux_path=\"$iso_path\"~g' ~/plescripts/global.cfg" |
133 | 142 | exec_cmd "sed -i 's~full_linux_iso_name=.*$~full_linux_iso_name=\"\$iso_olinux_path/$iso_name\"~g' ~/plescripts/global.cfg" |
134 | 143 | LN |
0 commit comments