source: src-sh/pc-extractoverlay/ports-overlay/usr/local/etc/rc.d/pefs @ f5021cc

9.2-releasereleng/10.0releng/10.0.1
Last change on this file since f5021cc was f5021cc, checked in by Kris Moore <kris@…>, 10 months ago

Fix location of pefs util

  • Property mode set to 100755
File size: 1019 bytes
Line 
1#!/bin/sh
2#
3# PROVIDE: pefs
4# REQUIRE: DAEMON pefs
5# KEYWORD: shutdown
6#
7# Add the following to /etc/rc.conf[.local] to enable this service
8#
9# pefs_enable="YES"
10#
11
12. /etc/rc.subr
13
14: ${pefs_enable="NO"}
15
16name=pefs
17rcvar=pefs_enable
18PEFSDBDIR="/var/db/pefs"
19
20command=/sbin/pefs
21export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
22start_cmd="pefs_start"
23
24pefs_start()
25{
26        if ! checkyesno pefs_enable ; then
27                return 0
28        fi
29
30        echo "Starting ${name}..."
31        if [ ! -e "${PEFSDBDIR}/auto_mounts" ];then
32           return 0
33        fi
34        while read pefsmnt
35        do
36                # Make sure pefs is not already mounted
37                mount | grep -q -e "${pefsmnt} on" -e "pefs" 
38                if [ $? -eq 0 ] ; then continue ; fi
39                source=`echo "$pefsmnt" | cut -d ' ' -f 1`
40                target=`echo "$pefsmnt" | cut -d ' ' -f 2`
41                if [ -z "$source" ]; then continue ; fi
42                if [ -z "${target}" ] ; then
43                        $command mount ${source} ${source}
44                else
45                        $command mount ${source} ${target}
46                fi
47        done < ${PEFSDBDIR}/auto_mounts
48}
49
50load_rc_config ${name}
51run_rc_command "$1" 
Note: See TracBrowser for help on using the repository browser.