#!/bin/bash
#  host - Host management support

set -e


######
# Settings

core_host_config_init() {
	lib_setting_vars host domain

	host=$(hostname)
	domain=$(hostname -d)
}


######
# Public interface

is_localhost() { [ "$1" = "$host" -o "$" = localhost ]; }


######
# Host power control

host_shutdown_run() {
	local flag=$1
	local when=${2:-now}
	run shutdown $flag "$when"
}

host_restart() { has_args 1 "$@"; host_shutdown_run -r "$1"; }
host_poweroff() { has_args 1 "$@"; host_shutdown_run -h "$1"; }

View the Script Reference Index


Generated on Tue Apr 25 21:20:08 PDT 2017 by mcsh i7 v0.18.0.