rc.subr (124797) | rc.subr (124832) |
---|---|
1# $NetBSD: rc.subr,v 1.49 2002/05/21 12:31:01 lukem Exp $ | 1# $NetBSD: rc.subr,v 1.49 2002/05/21 12:31:01 lukem Exp $ |
2# $FreeBSD: head/etc/rc.subr 124797 2004-01-21 16:36:17Z cperciva $ | 2# $FreeBSD: head/etc/rc.subr 124832 2004-01-22 08:46:03Z 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 --- 31 unchanged lines hidden (view full) --- 42# 43# Operating System dependent/independent variables 44# 45 46SYSCTL="/sbin/sysctl" 47SYSCTL_N="${SYSCTL} -n" 48CMD_OSTYPE="${SYSCTL_N} kern.ostype" 49OSTYPE=`${CMD_OSTYPE}` | 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 --- 31 unchanged lines hidden (view full) --- 42# 43# Operating System dependent/independent variables 44# 45 46SYSCTL="/sbin/sysctl" 47SYSCTL_N="${SYSCTL} -n" 48CMD_OSTYPE="${SYSCTL_N} kern.ostype" 49OSTYPE=`${CMD_OSTYPE}` |
50ID="/usr/bin/id" 51IDCMD="if [ -x $ID ]; then $ID -un; fi" |
|
50 51case ${OSTYPE} in 52FreeBSD) 53 SYSCTL_W="${SYSCTL}" 54 ;; 55NetBSD) 56 SYSCTL_W="${SYSCTL} -w" 57 ;; --- 441 unchanged lines hidden (view full) --- 499 else 500 eval rc_flags=\$${name}_flags 501 fi 502 eval _chdir=\$${name}_chdir _chroot=\$${name}_chroot \ 503 _nice=\$${name}_nice _user=\$${name}_user \ 504 _group=\$${name}_group _groups=\$${name}_groups 505 506 if [ -n "$_user" ]; then # unset $_user if running as that user | 52 53case ${OSTYPE} in 54FreeBSD) 55 SYSCTL_W="${SYSCTL}" 56 ;; 57NetBSD) 58 SYSCTL_W="${SYSCTL} -w" 59 ;; --- 441 unchanged lines hidden (view full) --- 501 else 502 eval rc_flags=\$${name}_flags 503 fi 504 eval _chdir=\$${name}_chdir _chroot=\$${name}_chroot \ 505 _nice=\$${name}_nice _user=\$${name}_user \ 506 _group=\$${name}_group _groups=\$${name}_groups 507 508 if [ -n "$_user" ]; then # unset $_user if running as that user |
507 if [ "$_user" = "$(id -un)" ]; then | 509 if [ "$_user" = "$(eval $IDCMD)" ]; then |
508 unset _user 509 fi 510 fi 511 512 # if ${rcvar} is set, and $1 is not 513 # "rcvar", then run 514 # checkyesno ${rcvar} 515 # and return if that failed --- 744 unchanged lines hidden --- | 510 unset _user 511 fi 512 fi 513 514 # if ${rcvar} is set, and $1 is not 515 # "rcvar", then run 516 # checkyesno ${rcvar} 517 # and return if that failed --- 744 unchanged lines hidden --- |