diff options
author | Arnaud Desmons <adesmons@mandriva.com> | 2002-09-05 07:37:06 +0000 |
---|---|---|
committer | Arnaud Desmons <adesmons@mandriva.com> | 2002-09-05 07:37:06 +0000 |
commit | f7cca6ea32444a7764d54989bf360530d07d6092 (patch) | |
tree | 779049ed3b297fa40354f497a5e0d6ca86505096 /server_wizard/scripts | |
parent | 52d4a220029dac288c8b86c3271ce9ab5fbdc6c2 (diff) | |
download | drakwizard-f7cca6ea32444a7764d54989bf360530d07d6092.tar drakwizard-f7cca6ea32444a7764d54989bf360530d07d6092.tar.gz drakwizard-f7cca6ea32444a7764d54989bf360530d07d6092.tar.bz2 drakwizard-f7cca6ea32444a7764d54989bf360530d07d6092.tar.xz drakwizard-f7cca6ea32444a7764d54989bf360530d07d6092.zip |
untouched
Diffstat (limited to 'server_wizard/scripts')
-rwxr-xr-x | server_wizard/scripts/check_config.sh | 50 | ||||
-rwxr-xr-x | server_wizard/scripts/check_domain.sh | 59 | ||||
-rwxr-xr-x | server_wizard/scripts/check_network.sh | 55 | ||||
-rwxr-xr-x | server_wizard/scripts/check_server_ip.sh | 65 | ||||
-rwxr-xr-x | server_wizard/scripts/compute_domain.sh | 38 | ||||
-rwxr-xr-x | server_wizard/scripts/compute_ipnet.sh | 44 | ||||
-rwxr-xr-x | server_wizard/scripts/compute_server_ip.sh | 39 | ||||
-rwxr-xr-x | server_wizard/scripts/do_it_last.sh | 49 | ||||
-rwxr-xr-x | server_wizard/scripts/do_it_net.sh | 207 | ||||
-rwxr-xr-x | server_wizard/scripts/liste_device.sh | 48 | ||||
-rwxr-xr-x | server_wizard/scripts/set_ip.sh | 40 | ||||
-rw-r--r-- | server_wizard/scripts/test.pl | 3 | ||||
-rwxr-xr-x | server_wizard/scripts/test.sh | 6 |
13 files changed, 703 insertions, 0 deletions
diff --git a/server_wizard/scripts/check_config.sh b/server_wizard/scripts/check_config.sh new file mode 100755 index 00000000..f44bd42c --- /dev/null +++ b/server_wizard/scripts/check_config.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# +# Wizard +# +# Copyright (C) 2000 Mandrakesoft. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# See file LICENSE for further informations on licensing terms. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi +# icons: Helene Durosini <ln@mandrakesoft.com> +# <corporate@mandrakesoft.com> http://www.mandrakesoft.com + +# script for wizard basic network configuration +# +# checking if the provided domain value is correct : +# strip the @, need at least a dot + +echo_debug "$(date) begin $0" + +fic=/etc/sysconfig/mdk_serv +if [ ! -f "$fic" ] ;then + . /etc/sysconfig/network + echo_debug "${HOSTNAME}" + echo_debug "${DOMAINNAME}" + echo -e "\ +# mdk server basic info $(date)\n\ +mdk_serv_version=1.0\n\ +wiz_device=eth0\n\ +wiz_host_name=${HOSTNAME}\n\ +wiz_domain_name=${DOMAINNAME}\n\ +" > ${fic} + +fi + echo_debug "${wiz_device}" + echo_debug "${wiz_host_name}" + echo_debug "${wiz_domain_name}" +exit 1 diff --git a/server_wizard/scripts/check_domain.sh b/server_wizard/scripts/check_domain.sh new file mode 100755 index 00000000..4575b069 --- /dev/null +++ b/server_wizard/scripts/check_domain.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# +# Wizard +# +# Copyright (C) 2000 Mandrakesoft. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# See file LICENSE for further informations on licensing terms. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi +# icons: Helene Durosini <ln@mandrakesoft.com> +# <corporate@mandrakesoft.com> http://www.mandrakesoft.com + +# script for wizard basic network configuration +# +# checking if the provided domain value is correct : +# strip the @, need at least a dot + +echo_debug "$(date) begin $0" + +if [ -z "${wiz_host_name}" ] ;then + echo_debug "wiz_host_name is empty, should not." + exit 1 +fi + + +test=`echo ${wiz_host_name##*@} |sed -e 's/[^0-9a-zA-Z-\.]//g'|sed -n -e's/^[^.]*\.\(.*\)$/\1/p'|grep "\."` + +htest=`echo ${wiz_host_name##*@} |sed -e 's/[^0-9a-zA-Z-\.]//g'|sed -n -e's/^\([^.]*\)\..*$/\1/p'` + +echo_debug "test of host : ${htest}" + +if [ -z "${htest}" ] ;then + echo_debug "host empty, should not." + exit 1 +fi + +echo_debug "test of domain : ${test}" + +if [ -z "${test}" ] ;then + echo_debug "domain empty, should not." + exit 1 +fi + +# all seems to be ok +exit 10 + diff --git a/server_wizard/scripts/check_network.sh b/server_wizard/scripts/check_network.sh new file mode 100755 index 00000000..6533dbb6 --- /dev/null +++ b/server_wizard/scripts/check_network.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# +# Wizard +# +# Copyright (C) 2000 Mandrakesoft. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# See file LICENSE for further informations on licensing terms. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi +# icons: Helene Durosini <ln@mandrakesoft.com> +# <corporate@mandrakesoft.com> http://www.mandrakesoft.com + +# script for wizard basic network configuration +# +# assuming : +# - C class network, mask 255.255.255.0 +# +# checking if the provided network address is correct + +echo_debug "$(date) begin $0" +# ip is tested as ip=a.b.c.d + +a=`echo ${wiz_ip_net}|sed -n -e 's/^\([0-9]\{1,3\}\)\..*$/\1/p'` +b=`echo ${wiz_ip_net}|sed -n -e 's/^[0-9]\{1,3\}\.\([0-9]\{1,3\}\)\..*$/\1/p'` +c=`echo ${wiz_ip_net}|sed -n -e 's/^[0-9]\{1,3\}\.[0-9]\{1,3\}\.\([0-9]\{1,3\}\)\..*$/\1/p'` +d=`echo ${wiz_ip_net}|sed -n -e 's/^.*\.\([0-9]\{1,3\}\)$/\1/p'` + +echo_debug "ip -$a-$b-$c-$d-" + +if [ -z "$a" -o -z "$b" -o -z "$c" -o -z "$d" ]; then + echo_debug "incomplete ip" + exit 1 +fi + +if [ $a -gt 255 -o $b -gt 255 -o $c -gt 255 -o $d -ne 0 ]; then + echo_debug "not a network ip" + exit 1 +fi + + +# all seems to be ok +exit 10 diff --git a/server_wizard/scripts/check_server_ip.sh b/server_wizard/scripts/check_server_ip.sh new file mode 100755 index 00000000..1b98fee0 --- /dev/null +++ b/server_wizard/scripts/check_server_ip.sh @@ -0,0 +1,65 @@ +#!/bin/bash +# +# Wizard +# +# Copyright (C) 2000 Mandrakesoft. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# See file LICENSE for further informations on licensing terms. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi +# icons: Helene Durosini <ln@mandrakesoft.com> +# <corporate@mandrakesoft.com> http://www.mandrakesoft.com + +# script for wizard basic network configuration +# +# assuming : +# - C class network, mask 255.255.255.0 +# +# checking if the provided server address is correct (belongs to network...) + +echo_debug "$(date) begin $0" +#truncating addresses +n_trunc=${wiz_ip_net%.*} +s_trunc=${wiz_ip_server%.*} +d=${wiz_ip_server##*.} + + +echo_debug "_${wiz_ip_net}_ _${wiz_ip_server}_ ${s_trunc} $d" + +if [ -z "${s_trunc}" ]; then + echo_debug "incorrect address" + exit 1 +fi + +if [ "${s_trunc}" != "${n_trunc}" ]; then + echo_debug "server not in network" + exit 1 +fi + +if [ -z "$d" ]; then + echo_debug "not a server ip" + exit 1 +fi + +if [ $d -gt 254 -o $d -lt 1 ]; then + echo_debug "not a server ip" + exit 1 +fi + + +# all seems to be ok +exit 10 + diff --git a/server_wizard/scripts/compute_domain.sh b/server_wizard/scripts/compute_domain.sh new file mode 100755 index 00000000..18bf2b76 --- /dev/null +++ b/server_wizard/scripts/compute_domain.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# Wizard +# +# Copyright (C) 2000 Mandrakesoft. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# See file LICENSE for further informations on licensing terms. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi +# icons: Helene Durosini <ln@mandrakesoft.com> +# <corporate@mandrakesoft.com> http://www.mandrakesoft.com + +# script for wizard basic network configuration +# +# return on stdout the domain name (computed from hostname) + +echo_debug "$(date) begin $0" +test=`echo ${wiz_host_name##*@}|sed -e 's/[^0-9a-zA-Z-\.]//g'|sed -n -e's/^[^.]*\.\(.*\)$/\1/p'` + +echo_debug "computed domain: ${test}" + +echo ${test} + +exit 0 + diff --git a/server_wizard/scripts/compute_ipnet.sh b/server_wizard/scripts/compute_ipnet.sh new file mode 100755 index 00000000..98387e58 --- /dev/null +++ b/server_wizard/scripts/compute_ipnet.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# +# Wizard +# +# Copyright (C) 2000 Mandrakesoft. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# See file LICENSE for further informations on licensing terms. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi +# icons: Helene Durosini <ln@mandrakesoft.com> +# <corporate@mandrakesoft.com> http://www.mandrakesoft.com + +# script for wizard basic network configuration +# +# return on stdout the default value for server ip address + +echo_debug "$(date) begin $0" +echo_debug "$wiz_device" + +nfile="/etc/sysconfig/network-scripts/ifcfg-${wiz_device}" +t=`get_val ${nfile} NETWORK` +if [ -z "$t" ]; then + echo ${wiz_ip_net} +else + echo "$t" +fi + +echo_debug "net adr : ${t}" + +exit 0 + diff --git a/server_wizard/scripts/compute_server_ip.sh b/server_wizard/scripts/compute_server_ip.sh new file mode 100755 index 00000000..c16c9a80 --- /dev/null +++ b/server_wizard/scripts/compute_server_ip.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# +# Wizard +# +# Copyright (C) 2000 Mandrakesoft. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# See file LICENSE for further informations on licensing terms. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi +# icons: Helene Durosini <ln@mandrakesoft.com> +# <corporate@mandrakesoft.com> http://www.mandrakesoft.com + +# script for wizard basic network configuration +# +# return on stdout the default value for server ip address + +echo_debug "$(date) begin $0" + +adr="${wiz_ip_net%.*}.1" + +echo_debug "serv adr : ${adr}" + +echo ${adr} + +exit 0 + diff --git a/server_wizard/scripts/do_it_last.sh b/server_wizard/scripts/do_it_last.sh new file mode 100755 index 00000000..479be201 --- /dev/null +++ b/server_wizard/scripts/do_it_last.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# +# Wizard +# +# Copyright (C) 2000 Mandrakesoft. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# See file LICENSE for further informations on licensing terms. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi +# icons: Helene Durosini <ln@mandrakesoft.com> +# <corporate@mandrakesoft.com> http://www.mandrakesoft.com + +# script for wizard network configuration +# +# restarting all services + +# putting a few infos in /etc/sysconfig/mdk_serv file + +echo_debug "$(date) begin $0" +fic=/etc/sysconfig/mdk_serv + +bck_file ${fic} + +echo_debug "saving server basic info" + +echo -e "\ +# mdk server basic info $(date)\n\ +mdk_serv_version=1.0\n\ +wiz_device=${wiz_device}\n\ +wiz_host_name=${wiz_host_name}\n\ +wiz_domain_name=${wiz_domain_name}\n\ +" > ${fic} + + +# all is ok +exit 10 diff --git a/server_wizard/scripts/do_it_net.sh b/server_wizard/scripts/do_it_net.sh new file mode 100755 index 00000000..839dda54 --- /dev/null +++ b/server_wizard/scripts/do_it_net.sh @@ -0,0 +1,207 @@ +#!/bin/bash +# +# Wizard +# +# Copyright (C) 2000 Mandrakesoft. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# See file LICENSE for further informations on licensing terms. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi +# icons: Helene Durosini <ln@mandrakesoft.com> +# <corporate@mandrakesoft.com> http://www.mandrakesoft.com + +# script for wizard network configuration +# +# install default for network +# change files : +# /etc/sysconfig/network +# /etc/sysconfig/network-cripts/ifcfg-ethx +# /etc/hosts +# /etc/HOSTNAME +# + +echo_debug "$(date) begin $0" + +if [ ! -f /etc/sysconfig/network ]; then + [ -d /etc/sysconfig ] || exit 1 + echo_debug "warning, no network file" + echo "# warning, this file was not create during install $(date)"\ + > /etc/sysconfig/network +fi + +bck_file /etc/sysconfig/network + +# first loading values +. /etc/sysconfig/network + +# default value for netmask +export wiz_ip_netmask=255.255.255.0 + +# configuring /etc/sysconfig/network + +if [ "${FORWARD_IPV4}" = "false" ]; then + echo_debug "putting FORWARD_IPV4 to \"yes\"" + chg_val /etc/sysconfig/network FORWARD_IPV4 yes +fi + +if [ "${HOSTNAME}" != "${wiz_host_name}" ]; then + echo_debug "changing hostname from ${HOSTNAME} to ${wiz_host_name}" + chg_val /etc/sysconfig/network HOSTNAME ${wiz_host_name} +fi + +if [ "${DOMAINNAME}" != "${wiz_domain_name}" ]; then + echo_debug "changing domain name from ${DOMAINNAME} to ${wiz_domain_name}" + chg_val /etc/sysconfig/network DOMAINNAME ${wiz_domain_name} +fi + +if [ "${NETWORKING}" != "yes" ]; then + echo_debug "WARNING, NETWORKING was ${NETWORKING}" + chg_val /etc/sysconfig/network NETWORKING yes +fi + +if [ "${GATEWAYDEV}" != "${wiz_extn_device}" ]; then + echo_debug "changing GATEWAYDEV name from ${GATEWAYDEV} to ${wiz_extn_device}" + chg_val /etc/sysconfig/network GATEWAYDEV ${wiz_extn_device} +fi + +if [ "${GATEWAY}" != "${wiz_extn_gateway}" ]; then + echo_debug "changing GATEWAY name from ${GATEWAY} to ${wiz_extn_gateway}" + chg_val /etc/sysconfig/network GATEWAY ${wiz_extn_gateway} +fi + + +# now reloading +echo_debug "reloading net params" +. /etc/sysconfig/network + +# configuring /etc/sysconfig/network-scripts/. +file="/etc/sysconfig/network-scripts/ifcfg-${wiz_device}" + +if [ -f ${file} ]; then + echo_debug "WARNING ${file} already exists, saved." + bck_file ${file} + oldip=`get_val ${file} IPADDR` +else + oldip="" + touch ${file} +fi + + +echo_debug "starting chg_val sequence" + +chg_val ${file} DEVICE "${wiz_device}" +chg_val ${file} BOOTPROTO none +chg_val ${file} IPADDR "${wiz_ip_server}" +# by default, just accept ../24 network : +chg_val ${file} NETMASK "${wiz_ip_netmask}" +chg_val ${file} NETWORK "${wiz_ip_net}" +chg_val ${file} BROADCAST "${wiz_ip_net%.*}.255" +chg_val ${file} ONBOOT yes +chg_val ${file} IPXNETNUM_802_2 "" +chg_val ${file} IPXPRIMARY_802_2 no +chg_val ${file} IPXACTIVE_802_2 no +chg_val ${file} IPXNETNUM_802_3 "" +chg_val ${file} IPXPRIMARY_802_3 no +chg_val ${file} IPXACTIVE_802_3 no +chg_val ${file} IPXNETNUM_ETHERII "" +chg_val ${file} IPXPRIMARY_ETHERII no +chg_val ${file} IPXACTIVE_ETHERII no +chg_val ${file} IPXNETNUM_SNAP "" +chg_val ${file} IPXPRIMARY_SNAP no +chg_val ${file} IPXACTIVE_SNAP no + +echo_debug "chg_val sequence ended" + +#loading new values +. ${file} + + +# now setup of /etc/hosts +# +# <warning> all this assumes that ip address of server is hard coded +# in /etc/hosts, which may be wrong in some situations +# + + + +# first, storing new hostname (/etc/sysconfig/network has been reloaded) +bck_file /etc/HOSTNAME +echo ${HOSTNAME} > /etc/HOSTNAME +hostname ${HOSTNAME} +echo_debug "done hostname" + +hostalias=`echo ${HOSTNAME} |sed -e 's|^\([^.]*\)\..*$|\1|'` + +# replacing . by \. for use in sed command +chgipaddr=`echo ${IPADDR} |sed -e 's/\./\\./g'` + +TMPFILE=`mktemp /tmp/temp.XXXXXX` || exit 1 +TMPFIL2=`mktemp /tmp/temp.XXXXXX` || exit 1 +cat /etc/hosts > ${TMPFILE} +bck_file /etc/hosts +#cp -f /etc/hosts /var/tmp/wiz_bck/orig/ + +cat ${TMPFILE}|sed -e '/^[[:space:]]*'"${chgipaddr}"'[[:space:]]\{1,\}.*$/{ +i \ +# removed by mdk_serv script on '"$(date)"' +s//#&/ +a \ +'"${IPADDR} ${HOSTNAME} ${hostalias}"' +} +' > ${TMPFIL2} + +if [ -z "`grep -E "^[[:space:]]*${chipaddr}[[:space:]]+" ${TMPFIL2}`" ]; then + echo "${IPADDR} ${HOSTNAME} ${hostalias}" >> ${TMPFIL2} +fi + + + +if [ -n "${oldip}" -a "${oldip}" != "${IPADDR}" ]; then + chgoldip=`echo ${oldip} |sed -e 's/\./\\./g'` + cat ${TMPFIL2}|sed -e '/^[[:space:]]*'"${chgoldip}"'[[:space:]]\{1,\}.*$/{ +i \ +# removed by mdk_serv script on '"$(date)"' +s//#&/ +} +' > /etc/hosts +else + cat ${TMPFIL2} > /etc/hosts +fi + +rm -f ${TMPFIL2} +rm -f ${TMPFILE} + +echo_debug "done /etc/hosts" + + + +# +# </warning> see above +# + +# storing network values in /etc/sysconfig/mdk_serv +echo_debug "storing network values" +${CWD}/scripts/do_it_last.sh + +# restarting network +echo_debug "restarting network" +/etc/rc.d/init.d/network stop +/etc/rc.d/init.d/network start +echo_debug "done restarting network" + +# all is ok +exit 10 + diff --git a/server_wizard/scripts/liste_device.sh b/server_wizard/scripts/liste_device.sh new file mode 100755 index 00000000..0f830728 --- /dev/null +++ b/server_wizard/scripts/liste_device.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# +# Wizard +# +# Copyright (C) 2000 Mandrakesoft. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# See file LICENSE for further informations on licensing terms. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi +# icons: Helene Durosini <ln@mandrakesoft.com> +# <corporate@mandrakesoft.com> http://www.mandrakesoft.com + +# script for wizard basic network configuration +# +# return on stdout the list of allowed devices for network interfaces + +# this script should be improved (use of detect) + +liste="" + +liste=$liste"`ifconfig -a | awk ' /^eth/ { print $1"\n"$1, $4,":",$5 } '`\n" + +# display only configured device +#for i in 0 1 2 3 ;do +# liste=${liste}"eth$i\nethernet adapter \ +# `ifconfig -a | grep eth$i| sed -n -e '1{s/.*HWaddr \(.*\)$/\1/p;}'`\n" + +# liste=${liste}"eth$i\neth$i \ +# `dmesg | grep eth$i| sed -n -e '1{s/^[^:]*: *\(.*\)$/\1/p;}'`\n" +#done + +echo -ne "${liste}" + +exit 0 + diff --git a/server_wizard/scripts/set_ip.sh b/server_wizard/scripts/set_ip.sh new file mode 100755 index 00000000..e5787e95 --- /dev/null +++ b/server_wizard/scripts/set_ip.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# +# Wizard +# +# Copyright (C) 2000 Mandrakesoft. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# See file LICENSE for further informations on licensing terms. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Authors: Jerome Dumonteil, Maurizio De Cecco, Enzo Maggi +# icons: Helene Durosini <ln@mandrakesoft.com> +# <corporate@mandrakesoft.com> http://www.mandrakesoft.com + +# script for wizard basic network configuration +# +# assuming : +# - C class network, mask 255.255.255.0 +# +# checking if the provided network address is correct + +# ip is tested as ip=a.b.c.d + +echo_debug "$(date) begin $0" +echo_debug "$wiz_device" +file=/etc/sysconfig/mdk_serv +bck_file ${file} +chg_val ${file} wiz_device ${wiz_device} +exit 1 diff --git a/server_wizard/scripts/test.pl b/server_wizard/scripts/test.pl new file mode 100644 index 00000000..f1c7c1da --- /dev/null +++ b/server_wizard/scripts/test.pl @@ -0,0 +1,3 @@ +use Serverconf; + +Serverconf::do_it(); diff --git a/server_wizard/scripts/test.sh b/server_wizard/scripts/test.sh new file mode 100755 index 00000000..dabc4f38 --- /dev/null +++ b/server_wizard/scripts/test.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +#if [ -n "${oldip}" -a "${oldip}" != "${IPADDR}" ]; then +if [ -f "/etc/motd" -a "${oldip}" != "${IPADDR}" ]; then +echo "toto\n" +fi
\ No newline at end of file |