rc.subr (127345) | rc.subr (130161) |
---|---|
1# $NetBSD: rc.subr,v 1.60 2003/07/26 05:13:47 lukem Exp $ | 1# $NetBSD: rc.subr,v 1.60 2003/07/26 05:13:47 lukem Exp $ |
2# $FreeBSD: head/etc/rc.subr 127345 2004-03-23 23:22:35Z brooks $ | 2# $FreeBSD: head/etc/rc.subr 130161 2004-06-06 18:06:09Z mtm $ |
3# 4# Copyright (c) 1997-2002 The NetBSD Foundation, Inc. 5# All rights reserved. 6# 7# This code is derived from software contributed to The NetBSD Foundation 8# by Luke Mewburn. 9# 10# Redistribution and use in source and binary forms, with or without --- 798 unchanged lines hidden (view full) --- 809run_rc_script() 810{ 811 _file=$1 812 _arg=$2 813 if [ -z "$_file" -o -z "$_arg" ]; then 814 err 3 'USAGE: run_rc_script file arg' 815 fi 816 | 3# 4# Copyright (c) 1997-2002 The NetBSD Foundation, Inc. 5# All rights reserved. 6# 7# This code is derived from software contributed to The NetBSD Foundation 8# by Luke Mewburn. 9# 10# Redistribution and use in source and binary forms, with or without --- 798 unchanged lines hidden (view full) --- 809run_rc_script() 810{ 811 _file=$1 812 _arg=$2 813 if [ -z "$_file" -o -z "$_arg" ]; then 814 err 3 'USAGE: run_rc_script file arg' 815 fi 816 |
817 trap "echo 'Reboot interrupted'; exit 1" 3 818 | |
819 unset name command command_args command_interpreter \ 820 extra_commands pidfile procname \ 821 rcvar required_dirs required_files required_vars 822 eval unset ${_arg}_cmd ${_arg}_precmd ${_arg}_postcmd 823 824 case "$_file" in 825 *.sh) # run in current shell 826 set $_arg ; . $_file 827 ;; 828 *[~#]|*.OLD|*.orig|*,v) # scratch file; skip 829 warn "Ignoring scratch file $_file" 830 ;; 831 *) # run in subshell 832 if [ -x $_file ]; then 833 if [ -n "$rc_fast_and_loose" ]; then 834 set $_arg ; . $_file 835 else | 817 unset name command command_args command_interpreter \ 818 extra_commands pidfile procname \ 819 rcvar required_dirs required_files required_vars 820 eval unset ${_arg}_cmd ${_arg}_precmd ${_arg}_postcmd 821 822 case "$_file" in 823 *.sh) # run in current shell 824 set $_arg ; . $_file 825 ;; 826 *[~#]|*.OLD|*.orig|*,v) # scratch file; skip 827 warn "Ignoring scratch file $_file" 828 ;; 829 *) # run in subshell 830 if [ -x $_file ]; then 831 if [ -n "$rc_fast_and_loose" ]; then 832 set $_arg ; . $_file 833 else |
836 ( trap "echo 'Reboot interrupted'; exit 1" 3 | 834 ( trap "echo Script $_file interrupted; kill -QUIT $$" 3 835 trap "echo Script $_file interrupted; exit 1" 2 |
837 set $_arg ; . $_file ) 838 fi 839 fi 840 ;; 841 esac 842} 843 844# --- 444 unchanged lines hidden --- | 836 set $_arg ; . $_file ) 837 fi 838 fi 839 ;; 840 esac 841} 842 843# --- 444 unchanged lines hidden --- |