$NetBSD: patch-aa,v 1.1.1.1 2003/06/27 12:01:12 agc Exp $ --- tob 2003/06/27 11:08:36 1.1 +++ tob 2003/06/27 11:13:55 @@ -1,4 +1,4 @@ -#!/bin/bash +#! /bin/sh # # tob --- Tape Oriented Backup # @@ -13,8 +13,8 @@ # # File locations -TOBLISTS=/var/lib/tob -TOBHOME=/etc/tob +TOBLISTS=/var/tob +TOBHOME=@PKG_SYSCONFDIR@/tob ############################################################################ # Global settings, most of which can be overruled in the resource file: @@ -77,13 +77,17 @@ fi elif [ -x /usr/bin/mktemp ] then - TMPLIST=`mktemp -p tob` + case `uname -s` in + NetBSD) prefarg="-t" ;; + *) prefarg="-p" ;; + esac + TMPLIST=`mktemp $prefarg tob` rc1=$? - FILELIST=`mktemp -p tob` + FILELIST=`mktemp $prefarg tob` rc2=$? - TMPLIST1=`mktemp -p tob` + TMPLIST1=`mktemp $prefarg tob` rc3=$? - TMPLIST2=`mktemp -p tob` + TMPLIST2=`mktemp $prefarg tob` rc4=$? if [ $rc1 -ne 0 -o $rc2 -ne 0 -o $rc3 -ne 0 -o $rc4 -ne 0 ] then @@ -131,7 +135,7 @@ VER=0.25 # RCLIST: list of resource files which tob will search for -RCLIST='/usr/local/etc/tob.rc /etc/tob/tob.rc /etc/tob.rc /usr/etc/tob.rc' +RCLIST='@PKG_SYSCONFDIR@/tob/tob.rc /usr/local/etc/tob.rc /etc/tob/tob.rc /etc/tob.rc /usr/etc/tob.rc' ############################################################################ # show a message to the screen @@ -189,6 +193,10 @@ if [ "$EXT" = "" ] ; then error "variable EXT is undefined" fi + + case "$UID" in + "") UID=`id -u` ;; + esac if [ "$NEEDROOT" = "yes" ] ; then if [ $UID -ne 0 ]; then