diff options
author | Matt Wilson <msw@redhat.com> | 2000-02-15 04:11:16 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 2000-02-15 04:11:16 +0000 |
commit | 7663bc1e151d76e813fa1c4f2e1d3516f3c1d67f (patch) | |
tree | 6870184bc0c32ae86e346b143658a627c5d95b4f /iutil.py | |
parent | b8b2999adc91dbdb8f75ad8e8c95035eca6a0087 (diff) | |
download | anaconda-7663bc1e151d76e813fa1c4f2e1d3516f3c1d67f.tar.gz anaconda-7663bc1e151d76e813fa1c4f2e1d3516f3c1d67f.tar.xz anaconda-7663bc1e151d76e813fa1c4f2e1d3516f3c1d67f.zip |
set system clock on upgrade
Diffstat (limited to 'iutil.py')
-rw-r--r-- | iutil.py | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -240,3 +240,40 @@ def validUser (user): return 1 +def setClock (root): + # eeeeew, inline shell. ;) + args = ("bash", "-c", """ +if [ -f /etc/sysconfig/clock ]; then + . /etc/sysconfig/clock + + # convert old style clock config to new values + if [ "${CLOCKMODE}" = "GMT" ]; then + UTC=true + elif [ "${CLOCKMODE}" = "ARC" ]; then + ARC=true + fi +fi + +CLOCKFLAGS="--hctosys" + +case "$UTC" in + yes|true) + CLOCKFLAGS="$CLOCKFLAGS -u"; + ;; +esac + +case "$ARC" in + yes|true) + CLOCKFLAGS="$CLOCKFLAGS -A"; + ;; +esac +case "$SRM" in + yes|true) + CLOCKFLAGS="$CLOCKFLAGS -S"; + ;; +esac +/sbin/hwclock $CLOCKFLAGS +""") + execWithRedirect('/bin/sh', args, stdin = None, + stdout = None, stderr = None, + root = root) |