代码拉取完成,页面将自动刷新
#!/bin/sh
PROGNAME="$0"
usage() {
cat <<EOF
NAME
`basename $PROGNAME` - freebsd-install
SYNOPSIS
`basename $PROGNAME` [options]
DESCRIPTION
freebsd-install
OPTIONS
-D lvl Debug level
EOF
exit 1
}
#
# Report an error and exit
#
error() {
echo "`basename $PROGNAME`: $1" >&2
exit 1
}
debug() {
if [ $DEBUG -ge $1 ]; then
echo "`basename $PROGNAME`: $2" >&2
fi
}
#
# Process the options
#
DEBUG=0
while getopts "D:h?" opt
do
case $opt in
D) DEBUG="$OPTARG";;
h|\?) usage;;
esac
done
shift `expr $OPTIND - 1`
#
# Main Program
#
RULES=/tmp/devfs.rules
RC_CONF=/tmp/rc.conf
RULES=/etc/devfs.rules
RC_CONF=/etc/rc.conf
RULESET_NAME=printers_foo2zjs
RULESET_NUM=42
RULESET="[$RULESET_NAME=$RULESET_NUM]"
#
# Create devfs.rules
#
touch $RULES
if grep -s -q "Begin $RULESET_NAME" $RULES; then
ex - $RULES <<-EOF
/^# Begin $RULESET_NAME.*/,/^# End $RULESET_NAME.*/d
w
q
EOF
fi
ex - $RULES <<-EOF
a
# Begin $RULESET_NAME (added by foo2zjs/freebsd-install)
$RULESET
add path 'ulpt*' mode 0666 group cups
add path 'unlpt*' mode 0666 group cups
add path 'ugen*' mode 0666 group cups
add path 'usb/*' mode 0666 group cups
# End $RULESET_NAME (added by foo2zjs/freebsd-install)
.
w
q
EOF
#
# Add: devfs_system_ruleset="printers_foo2zjs"
#
if grep -q -s $RULESET_NAME $RC_CONF; then
ex - $RC_CONF <<-EOF
/devfs_system_ruleset="$RULESET_NAME"/d
w
q
EOF
fi
ex - $RC_CONF <<-EOF
a
devfs_system_ruleset="$RULESET_NAME"
.
w
q
EOF
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。