#!/bin/bash
################################################################################
# Filename: ./src/base/include/dist_specific.d/suse_80
# 
# The contents of this file are subject to the Qlusters Public License
# Version 1.1 (the License); you may not use this file except in compliance
# with the License.
# You may obtain a copy of the License at
# http://www.openqrm.org/content/view/33/69/.
# 
# Software distributed under the License is distributed on an AS IS basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
# the specific language governing rights and limitations under the License.
# 
# The Original Code is openQRM.
# 
# The Initial Developer of the Original Code is Qlusters Corporation. Portions
# created by Qlusters Corporation are Copyright (C) 2003-2005. All Rights
# Reserved.
# 
# Contributor(s):
# 
# Description:
# 
# Comments:
################################################################################


# service commands:
function _services_list() {
	chroot $QRM_FILESYSTEM_IMAGE_ROOT_FS chkconfig --list
}

function _services_install() {
	# install service on a system
	chroot $QRM_FILESYSTEM_IMAGE_ROOT_FS chkconfig --add $1
}

function _services_enable() {
	chroot $QRM_FILESYSTEM_IMAGE_ROOT_FS chkconfig $1 2345
	return $?
}

function _services_disable() {
	chroot $QRM_FILESYSTEM_IMAGE_ROOT_FS chkconfig $1 off
}

function _services_remove() {
	chroot $QRM_FILESYSTEM_IMAGE_ROOT_FS chkconfig --del $1
}

function _image_base_services() {
    echo "boot.clock boot.ldconfig boot.device-mapper boot.localfs boot.localnet boot.proc boot.rootfsck boot.shm \
    keytable syslog netfs random xinetd sshd xinetd local network halt ifupdown networking inetd klogd makedev \
    modutils reboot rmnologin sendsigs sysklogd umountfs urandom nfslock portmap"
}

function __mandatory_image_services__() {
	echo "nfslock"
}

function _image_list_network_interfaces() {
	ls $QRM_FILESYSTEM_IMAGE_ROOT_FS/etc/sysconfig/network/ifcfg-eth* 2>/dev/null
}

function _image_set_hostname() {
	echo "$QRM_FILESYSTEM_IMAGE_HOSTNAME" > $QRM_FILESYSTEM_IMAGE_ROOT_FS/etc/HOSTNAME	
}


