56 lines
774 B
Bash
Executable File
56 lines
774 B
Bash
Executable File
#!/bin/bash
|
|
|
|
rc.hostname() { hostname "$cfg_hostname"; }
|
|
|
|
rc.services() {
|
|
local service_name bg_start
|
|
|
|
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"
|
|
}
|
|
done
|
|
}
|
|
|
|
rc.boot() {
|
|
rc.hostname
|
|
rc.modules
|
|
rc.services start
|
|
}
|
|
|
|
rc.shutdown() {
|
|
rc.services stop
|
|
}
|
|
|
|
rc.hostname() {
|
|
[[ "$cfg_hostname" ]] && { hostname "$cfg_hostname"; }
|
|
}
|
|
|
|
rc.modules() {
|
|
for i in "${cfg_modules[@]}"; do
|
|
modprobe "$i"
|
|
done
|
|
}
|
|
|
|
source "/etc/rc.conf"
|
|
|
|
action="$1"
|
|
action="${action:-boot}"
|
|
|
|
case "$action" in
|
|
boot)
|
|
echo "Welcome to `uname -rs`"
|
|
rc.boot
|
|
;;
|
|
shutdown) rc.shutdown;;
|
|
esac
|