summaryrefslogtreecommitdiffstats
path: root/usr.sbin/xntpd/refclocks/setupfn
blob: 5724dcb52da6c6dde9e83dcd2dc3e1f8b1d951a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#
# sh io functions
#
if [ "`echo -n`" = "-n" ]; then
  echon () { echo "$@\\c"; }
else
  echon () { echo -n "$@"; }
fi

query() {
  _Q="$1"
  _A="$2"
  echon "$_Q (y/n) [$_A] ? "
  X=""
  read X
  if [ "$X" = "" ]; then
    X="$_A"
  fi
  case "$X" in
    [yY]*) return 0;;
	*) return 1;;
  esac
}

check () {
  `echo "$1" | awk '{ if ( '"$2"' ) { print ":"; } else { print "false"; } exit; }'`;
}
OpenPOWER on IntegriCloud