background start

This commit is contained in:
Jack L. Frost 2014-02-24 11:20:05 +04:00
parent bdc29d114c
commit 54c276fb9e
2 changed files with 15 additions and 2 deletions

13
bin/rc
View File

@ -3,8 +3,21 @@
rc.hostname() { hostname "$cfg_hostname"; } rc.hostname() { hostname "$cfg_hostname"; }
rc.services() { rc.services() {
local service_name bg_start
for i in "${cfg_services[@]}"; do for i in "${cfg_services[@]}"; do
[[ "$i" =~ ^@ ]] && {
service_name="${i##*@}"
bg_start='1'
} || {
service_name="$i"
}
[[ "$bg_start" ]] && {
"${cfg_initscripts_dir}/$i" "$1" & true
} || {
"${cfg_initscripts_dir}/$i" "$1" "${cfg_initscripts_dir}/$i" "$1"
}
done done
} }

View File

@ -4,5 +4,5 @@ export PATH='/usr/local/bin:/usr/bin'
cfg_initscripts_dir='/etc/rc.d' cfg_initscripts_dir='/etc/rc.d'
cfg_hostname='generic' cfg_hostname='generic'
cfg_services=( 'fsck' 'udev' 'mount' 'syslog-ng' 'crond' 'network' 'dhcpcd' 'sshd' 'rc.local' ) cfg_services=( 'fsck' 'udev' 'mount' 'syslog-ng' 'crond' 'network' 'dhcpcd' '@sshd' 'rc.local' )
# cfg_modules=() # cfg_modules=()