diff options
author | Arnaud Desmons <adesmons@mandriva.com> | 2002-09-02 14:11:30 +0000 |
---|---|---|
committer | Arnaud Desmons <adesmons@mandriva.com> | 2002-09-02 14:11:30 +0000 |
commit | 49050b263948bdee8987ccc1f0c576fc2d0830ec (patch) | |
tree | 6eea18fe5e44d6f151466f61559996cf0d596e59 /time_wizard | |
parent | 04143a661a72da86d0eeadd41e09c1293cd8cce7 (diff) | |
download | drakwizard-49050b263948bdee8987ccc1f0c576fc2d0830ec.tar drakwizard-49050b263948bdee8987ccc1f0c576fc2d0830ec.tar.gz drakwizard-49050b263948bdee8987ccc1f0c576fc2d0830ec.tar.bz2 drakwizard-49050b263948bdee8987ccc1f0c576fc2d0830ec.tar.xz drakwizard-49050b263948bdee8987ccc1f0c576fc2d0830ec.zip |
deprecated
Diffstat (limited to 'time_wizard')
-rwxr-xr-x | time_wizard/scripts/handle_local_internet.sh | 65 | ||||
-rwxr-xr-x | time_wizard/scripts/handle_no_network.sh | 49 | ||||
-rwxr-xr-x | time_wizard/scripts/install_rpm.sh | 75 | ||||
-rwxr-xr-x | time_wizard/scripts/save_config.sh | 91 | ||||
-rwxr-xr-x | time_wizard/scripts/test_timeservers.sh | 105 | ||||
-rwxr-xr-x | time_wizard/scripts/test_tools.sh | 39 |
6 files changed, 0 insertions, 424 deletions
diff --git a/time_wizard/scripts/handle_local_internet.sh b/time_wizard/scripts/handle_local_internet.sh deleted file mode 100755 index 3fe4528f..00000000 --- a/time_wizard/scripts/handle_local_internet.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/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 - -#This script use the value of the variable $chooser1 (== 'local' or 'internet') -#as follows: -# -#if $chooser1 == 'local', -#- call the standard time setting tool and then output the string "ciao" -# -#if $chooser1 == 'internet', -# test the existence of the network. -# if it exists, call the script test_tools.sh -# else output 'page3' - -# (if chooser1 is different from 'local' and 'internet', return an error code) - - - -echo_debug "$(date) begin $0, loading /etc/sysconfig/network" - -. /etc/sysconfig/network - -echo_debug "chooser1=${chooser1}" - -[ -n "${chooser1}" ] || exit 1 - -echo_debug "NETWORKING=${NETWORKING} chooser1=${chooser1} timetool=${timetool}" - -case "${chooser1}" in -local) - exit 1 - ;; -internet) - echo_debug "NETWORKING=${NETWORKING}" - [ ${NETWORKING} = "no" ] && exit 2 - echo_debug "launching test_tools.sh" - exec /usr/share/wizards/time_wizard/scripts/test_tools.sh - ;; -*) - echo_debug "a bug ?" - exit -1 -esac - diff --git a/time_wizard/scripts/handle_no_network.sh b/time_wizard/scripts/handle_no_network.sh deleted file mode 100755 index 371673ad..00000000 --- a/time_wizard/scripts/handle_no_network.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/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 -# -# no network was found, than $chooser4 tell us to : -# - tryagain -# - save config without testing -# - - -echo_debug "$(date) begin $0, whith chooser4=${chooser4}" - -case "${chooser4}" in -tryagain) - echo_debug "server_not_responding" - exit 1 - ;; -savewithouttest) - echo_debug "exec __WIZ_HOME__/time_wizard/scripts/save_config.sh" - exec exec __WIZ_HOME__/time_wizard/scripts/save_config.sh - echo_debug "saying ciao" - exit 2 - ;; -*) - echo_debug "bug" - exit 1 - ;; -esac diff --git a/time_wizard/scripts/install_rpm.sh b/time_wizard/scripts/install_rpm.sh deleted file mode 100755 index c7989c07..00000000 --- a/time_wizard/scripts/install_rpm.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/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 - -# This script installs the "NTP utils" (URPMI or KDE package) -# This will be eventually made more generic to create a -# RPM installer script. -# it outputs "choose_server" if OK, "not_installed" otherwise - -echo_debug () { -([ -n "${DEBUG_WIZ}" ] && echo $1 >> ${DEBUG_WIZ})||: -} - - -echo_debug "$(date) begin $0" - -rpmname="ntp" -rpm=`which rpm` -urpmi=`which urpmi` - -# quit if package already installed - -if [ `$rpm --quiet -q ${rpmname} 2>/dev/null` ];then - echo_debug "package ${rpmname} already installed, saying choose_server" - exit 1 -fi - -# try to install the $rpmname package by some way - -if [ -x "$urpmi" ]; then - echo_debug "found urpmi, installing ${rpmname}" - $urpmi --X --auto ${rpmname} >/dev/stderr 2>&1 -else - echo_debug "urpmi not found. can't install ${rpmname}" - exit 1 -#elif [ -d /mnt/cdrom/Mandrake/RPMS ]; then -# echo_debug "found ${rpmname} on local cdrom, installing using rpm" -# rpmfile=`find /mnt/cdrom/Mandrake/RPMS -name "${rpmname}-*.rpm"` -# rpm -U --quiet ${rpmfile} >/dev/stderr 2>&1 -fi - -# test if all is ok (and provide exit code) -echo_debug "exiting, testing: $($rpm --quiet -q ${rpmname} 2>/dev/null)" - -if [ `$rpm --quiet -q ${rpmname} 2>/dev/null` ]; then - exit 1 -else -# if [ -x /usr/X11R6/bin/rpmdrake ]; then -# # should display some help here -# echo_debug "launching rpmdrake as last choice" -# /usr/X11R6/bin/rpmdrake > /dev/null 2>&1 & -# fi - exit 2 -fi diff --git a/time_wizard/scripts/save_config.sh b/time_wizard/scripts/save_config.sh deleted file mode 100755 index a0bcebfa..00000000 --- a/time_wizard/scripts/save_config.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/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 - -# this script saves the xntp configuration. - -echo_debug "$(date) begin $0" - -# save time zone info -config=/etc/sysconfig/clock -bck_file ${config} - -echo -e "\ -UTC=true\n\ -ZONE=${wiz_timezone}\n\ -ARC=false\ -" > ${config} - -export TZ=${wiz_timezone} - -cp -f /usr/share/zoneinfo/${wiz_timezone} /etc/localtime - - - -if [ -n "${typedserver1}" ]; then - tserver1=${typedserver1} -else - tserver1=${server1} -fi - -if [ -n "${typedserver2}" ]; then - tserver2=${typedserver2} -else - tserver2=${server2} -fi - -# and set time ! - -echo_debug "tserver=${tserver1} tserver2=${tserver2}" - -[ -d /etc/ntp ] || exit 1 -echo_debug "/etc/ntp ok" - -bck_file /etc/ntp/step-tickers - -if [ -n "${tserver1}" ]; then - echo ${tserver1} > /etc/ntp/step-tickers -fi - -if [ -n "${tserver2}" ]; then - echo ${tserver2} >> /etc/ntp/step-tickers -fi - -echo_debug "$(date) wrote /etc/ntp/step-tickers, starting services" - -# now set time (if network ok) -if [ "$wiz_time_ok" = "ok" ]; then -/etc/rc.d/init.d/crond stop > /dev/null -/etc/rc.d/init.d/atd stop > /dev/null -/etc/rc.d/init.d/ntpd restart > /dev/null -/etc/rc.d/init.d/crond start > /dev/null -/etc/rc.d/init.d/atd start > /dev/null - -# set hw clock -[ -x /sbin/hwclock ] && hwclock --systohc --utc & - -fi - -echo_debug "$(date) service restart end, exiting from $0" - diff --git a/time_wizard/scripts/test_timeservers.sh b/time_wizard/scripts/test_timeservers.sh deleted file mode 100755 index 3b45dcd3..00000000 --- a/time_wizard/scripts/test_timeservers.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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 - -# This script perform a test of the time servers whose names -# can be found into the variables -# - $server1 -# - $typedserver1 -# - $server2 -# - $typesserver2 -# The typed variables have precedence over the fixed, if they are not empty. -# This test (ntpdate...) have a fixed timeout. -# If the test succeeds, it calls the script save_config.sh and then outputs 'ciao' -# else, it outputs 'server_not_responding' - -echo_debug "$(date)= begin $0" - -tout=30 -typeset -i i - -if [ -n "${typedserver1}" ]; then - tserver1=${typedserver1} -else - tserver1=${server1} -fi - -if [ -n "${typedserver2}" ]; then - tserver2=${typedserver2} -else - tserver2=${server2} -fi - -echo_debug "tserver1=${tserver1} tserver2=${tserver2}" - -if [ -x /usr/sbin/ntpdate ] && [ -n "${tserver1}" -o -n "${tserver2}" ]; then - echo_debug "launching /usr/sbin/ntpdate -q ${tserver1} ${tserver2}" - TMPFILE=`mktemp -q /tmp/tmwiz.XXXXXX` - if [ $? -ne 0 ];then - echo_debug "$0 cant create tmpfile, exit 1" - exit 1 - fi - - /usr/sbin/ntpdate -q ${tserver1} ${tserver2} > ${TMPFILE} 2>&1 & - - pid=$! - echo_debug "pid du process : ${pid}" - i=0 - ok=0 - while [ $ok -eq 0 ]; do - if [ `ps h ${pid} | wc -l` -eq 1 ]; then - i=i+1 - echo_debug "still running $i" - if [ $i -ge ${tout} ]; then - kill ${pid} >/dev/null 2>&1 - echo_debug "killing process" - echo_debug "server_not_responding" - exit 1 - else - sleep 1 - fi - else - echo_debug "ok end loop" - ok=1 - fi - done -# time server found? - - if [ `grep -c "no servers can be used" ${TMPFILE}` -ne 0 ];then - echo_debug "bad server" - echo_debug "$(cat ${TMPFILE})" - else - echo_debug "launching exec __WIZ_HOME__/time_wizard/scripts/save_config.sh" - __WIZ_HOME__/time_wizard/scripts/save_config.sh - echo_debug "exiting saying ciao" - rm -f ${TMPFILE} - exit 2 - fi -fi - -# some problem : -rm -f ${TMPFILE} -echo_debug "server_not_responding" -exit 1 - diff --git a/time_wizard/scripts/test_tools.sh b/time_wizard/scripts/test_tools.sh deleted file mode 100755 index 06f54c1f..00000000 --- a/time_wizard/scripts/test_tools.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/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 - -#Test the existence of the tools NTP (test -f /var/bin/ntpdate, rpm -q ntp) -#-- if the test succeeds, output "choose_server", -#- else "no_tools" - -echo_debug "$(date) begin $0" - -if [ -x /usr/sbin/ntpdate ] ; then - echo_debug "exiting, choose_server" - exit 3 -else - echo_debug "exiting, no_tools" - exit 4 -fi - |