-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrinstall.1
124 lines (124 loc) · 3.15 KB
/
rinstall.1
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
.\"
.\" Copyright (c) 2018 Eric Radman <[email protected]>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd September 24, 2024
.Dt RINSTALL 1
.Os
.Sh NAME
.Nm rinstall
.Nd fetch and install scripts from local or http source
.Sh SYNOPSIS
.Nm rinstall
.Op Fl a Ar URL
.Op Fl m Ar mode
.Op Fl o Ar owner:group
.Ar source
.Op Ar target
.Sh DESCRIPTION
.Nm
is shipped to remote machines by
.Xr rset 1
to provide a standard method of installing files made available over HTTP, or
from the current working directory for files already staged.
.Pp
The
.Ar target
must be an absolute path, and is created if it does not exist.
If the
.Ar target
exists but is not the same as
.Ar source ,
then
.Xr diff 1
is used to display the difference before it is updated.
If the
.Ar target
is omitted, the
.Ar source
is placed in the staging directory defined by the
.Ev SD
environment variable.
.Pp
If the source is defined absolute path it must exist on a file system on the
remote host.
If the source is defined with a relative path, then
.Nm
first checks if the source already exists in the
.Ev SD
and then tries to fetch it from the HTTP resource defined by
.Ev INSTALL_URL
or the
.Fl a
option.
.Pp
.Nm
always checks for a local copy of the
.Ar source
before attempting to fetch a file from the location defined by the environment
variable
.Ev INSTALL_URL .
.Pp
The arguments are as follows:
.Bl -tag -width Ds
.It Fl a
URL to an alternative file location.
.It Fl m
Mode to set when a file is updated.
This argument is passed to
.Xr chmod 1 .
.It Fl o
Owner and/or group to set.
This argument is passed to
.Xr chown 8 .
.El
.Sh ENVIRONMENT
.Bl -tag -width Ds
.It Ev RINSTALL_DIFF_ARGS
Arguments for
.Xr diff 1
tool.
The default is
.Qq -U 2 .
.El
.Sh EXIT STATUS
The
.Nm
utility exits with one of the following values:
.Pp
.Bl -tag -width Ds -offset indent -compact
.It 0
Target file was installed or updated
.It 1
No changes were made
.It 2
Unknown Operating System
.It 3
Unable to fetch requested file
.El
.Sh EXAMPLES
Install configuration file and set permissions
.Pp
.Dl $SD/rinstall -m 644 -o www:www resolv.conf /var/www/etc/
.Pp
Fetch latest copy of sources and extract
.Pp
.Dl $SD/rinstall wodpress.tar.gz
.Dl tar -xzf $SD/wordpress.tar.gz -C /var/www
.Pp
Fetch a file from an alternative location and store it in the staging directory
under tools/sys/ if it's not already there and it's not available at
$INSTALL_URL/tools/sys/sometool.tgz
.Pp
.Dl $SD/rinstall -a https://example.org/files/tool.tar.gz tools/sys/sometool.tgz