summaryrefslogtreecommitdiff
path: root/sysutils/tob/patches/patch-aa
blob: dcdc1f67274e206ab2a6947386490da0ab9baed2 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
$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