1if [ ! "$_MEDIA_NFS_SUBR" ]; then _MEDIA_NFS_SUBR=1
2#
3# Copyright (c) 2012-2013 Devin Teske
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
--- 10 unchanged lines hidden (view full) ---
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/share/media/nfs.subr 252987 2013-07-07 18:51:44Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." media/nfs.subr
34f_include $BSDCFG_SHARE/device.subr
35f_include $BSDCFG_SHARE/dialog.subr
--- 167 unchanged lines hidden (view full) ---
203 fi
204 NFS_MOUNTED=1
205
206 f_dprintf "Mounted NFS device %s onto %s" "$name" "$MOUNTPOINT"
207
208 return $SUCCESS
209}
210
211# f_media_get_nfs $device $file [$probe_only]
212#
213# Returns data from $file on a mounted NFS device. Similar to cat(1). If
214# $probe_only is present and non-NULL, returns success if $file exists.
215#
216f_media_get_nfs()
217{
218 local dev="$1" file="$2" probe_only="$3"
219
220 f_dprintf "f_media_get_nfs: dev=[%s] file=[%s] probe_only=%s" \
221 "$dev" "$file" "$probe_only"
222
223 f_media_generic_get "$MOUNTPOINT" "$file" "$probe_only"
224}
225
226# f_media_shutdown_nfs $device
227#
228# Shuts down the NFS device using umount(8). Return status should be ignored.
229#
230f_media_shutdown_nfs()
231{
--- 19 unchanged lines hidden ---
2#
3# Copyright (c) 2012-2013 Devin Teske
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
--- 10 unchanged lines hidden (view full) ---
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/share/media/nfs.subr 252987 2013-07-07 18:51:44Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." media/nfs.subr
34f_include $BSDCFG_SHARE/device.subr
35f_include $BSDCFG_SHARE/dialog.subr
--- 167 unchanged lines hidden (view full) ---
203 fi
204 NFS_MOUNTED=1
205
206 f_dprintf "Mounted NFS device %s onto %s" "$name" "$MOUNTPOINT"
207
208 return $SUCCESS
209}
210
211# f_media_get_nfs $device $file [$probe_only]
212#
213# Returns data from $file on a mounted NFS device. Similar to cat(1). If
214# $probe_only is present and non-NULL, returns success if $file exists.
215#
216f_media_get_nfs()
217{
218 local dev="$1" file="$2" probe_only="$3"
219
220 f_dprintf "f_media_get_nfs: dev=[%s] file=[%s] probe_only=%s" \
221 "$dev" "$file" "$probe_only"
222
223 f_media_generic_get "$MOUNTPOINT" "$file" "$probe_only"
224}
225
226# f_media_shutdown_nfs $device
227#
228# Shuts down the NFS device using umount(8). Return status should be ignored.
229#
230f_media_shutdown_nfs()
231{
--- 19 unchanged lines hidden ---