source: fedkit/make_hosts @ 8f91e66

axis_examplecompt_changesinfo-opsversion-1.30version-2.00version-3.01version-3.02
Last change on this file since 8f91e66 was 7c3008e, checked in by Ted Faber <faber@…>, 16 years ago

checkpoint

  • Property mode set to 100755
File size: 1.2 KB
Line 
1#!/bin/sh
2
3# Very simple script to copy the global hosts file over the local one
4# while preserving the localhost entry.  Run on DETER master clients
5
6grep 127\\.0\\.0\\.1 /etc/hosts > /tmp/hosts
7cat $1 >> /tmp/hosts
8cp /tmp/hosts /etc/hosts && rm /tmp/hosts
9
10
11# XXX Danger, hack ahead.  Apparently our FC6-SMB image and emulab disagree
12# about where gated lives.  This will alias it.
13if [ ! -x /usr/sbin/gated ] ; then 
14        if [ -x /sbin/gated ] ; then
15                ln /sbin/gated /usr/sbin/gated
16        fi
17fi
18/usr/local/etc/emulab/rc/rc.route
19
20# SEER feels pain and confusion if times are wrong.  This lays a big lick on
21# ntp sets the time directly and then restarts it.  XXX FreeBSD incantation is
22# untested.
23
24case `uname` in
25        "FreeBSD")
26                /etc/rc.d/ntpd stop
27                /usr/sbin/ntpdate boss
28                /etc/rc.d/ntpd start
29                ;;
30        "Linux")
31                /etc/rc.d/init.d/ntpd stop
32                /usr/sbin/ntpdate boss
33                /etc/rc.d/init.d/ntpd start
34                ;;
35esac
36
37# Execute any command passed in as a startcmd.  This basically daisy chains the
38# startcmd.  This needs to become a perl script to have uniform behavior here.
39echo "*$2* *$3*"
40if [ ! -z "$2" ]; then 
41        echo "calling *$2* *$3*"
42        case `uname` in
43                "FreeBSD")
44                        su -l "$2" -c "$3"
45                        ;;
46                "Linux")
47                        su "$2" --command="$3"
48                        ;;
49        esac
50fi
Note: See TracBrowser for help on using the repository browser.