gbde (116456) | gbde (125384) |
---|---|
1#!/bin/sh 2# 3# This file, originally written by Garrett A. Wollman, is in the public 4# domain. 5# | 1#!/bin/sh 2# 3# This file, originally written by Garrett A. Wollman, is in the public 4# domain. 5# |
6# $FreeBSD: head/etc/rc.d/gbde 116456 2003-06-17 02:56:29Z wollman $ | 6# $FreeBSD: head/etc/rc.d/gbde 125384 2004-02-03 10:21:35Z des $ |
7# 8 9# PROVIDE: disks 10# KEYWORD: FreeBSD 11 12. /etc/rc.subr 13 14name="gbde" 15start_precmd="find_gbde_devices start" 16stop_precmd="find_gbde_devices stop" 17start_cmd="gbde_start" 18stop_cmd="gbde_stop" 19 20find_gbde_devices() 21{ 22 case "${gbde_devices-auto}" in 23 [Aa][Uu][Tt][Oo]) | 7# 8 9# PROVIDE: disks 10# KEYWORD: FreeBSD 11 12. /etc/rc.subr 13 14name="gbde" 15start_precmd="find_gbde_devices start" 16stop_precmd="find_gbde_devices stop" 17start_cmd="gbde_start" 18stop_cmd="gbde_stop" 19 20find_gbde_devices() 21{ 22 case "${gbde_devices-auto}" in 23 [Aa][Uu][Tt][Oo]) |
24 gbde_devices="";; | 24 gbde_devices="" 25 ;; |
25 *) | 26 *) |
26 return 0;; | 27 return 0 28 ;; |
27 esac 28 29 case "$1" in | 29 esac 30 31 case "$1" in |
30 start) fstab="/etc/fstab";; 31 stop) fstab=$(mktemp /tmp/mtab.XXXXXX) | 32 start) 33 fstab="/etc/fstab" 34 ;; 35 stop) 36 fstab=$(mktemp /tmp/mtab.XXXXXX) |
32 mount -p >${fstab} | 37 mount -p >${fstab} |
38 ;; |
|
33 esac 34 35 # 36 # We can't use "mount -p | while ..." because when a shell loop 37 # is the target of a pipe it executes in a subshell, and so can't 38 # modify variables in the script. 39 # 40 while read device mountpt type options dump pass; do --- 15 unchanged lines hidden (view full) --- 56 gbde_devices="${gbde_devices} ${device}" 57 ;; 58 esac 59 ;; 60 esac 61 done <${fstab} 62 63 case "$1" in | 39 esac 40 41 # 42 # We can't use "mount -p | while ..." because when a shell loop 43 # is the target of a pipe it executes in a subshell, and so can't 44 # modify variables in the script. 45 # 46 while read device mountpt type options dump pass; do --- 15 unchanged lines hidden (view full) --- 62 gbde_devices="${gbde_devices} ${device}" 63 ;; 64 esac 65 ;; 66 esac 67 done <${fstab} 68 69 case "$1" in |
64 stop) rm -f ${fstab};; | 70 stop) 71 rm -f ${fstab} 72 ;; |
65 esac 66 67 return 0 68} 69 70gbde_start() 71{ 72 for device in $gbde_devices; do --- 20 unchanged lines hidden --- | 73 esac 74 75 return 0 76} 77 78gbde_start() 79{ 80 for device in $gbde_devices; do --- 20 unchanged lines hidden --- |