Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

67 lines (59 sloc) 2.6 kb
#!/bin/bash
# #
# init.lunar - Lunar subroutines #
# #
############################################################
# #
# this WAS the subroutines of a source based Linux distro, #
# calls Sorcerer GNU/Linux, or SGL. SGL is no longer #
# available with GPL license. Since this script was taken #
# before licensing scheme change, no legal problems I #
# guess. #
# #
# the code is re-written for Lunar. The previous Copyright #
# notices are kept; just in case some code is left :=) #
# Kagan Kongar <kongar@tsrsb.org.tr>, 20020519 #
# #
############################################################
# #
# Copyright 2001 by Kyle Sallee #
# #
# Parts Copyrighted Hendrik Visage 2002 under GPLv2 #
# #
# Parts Copyrighted Kagan Kongar 2002 under GPLv2 #
# #
############################################################
# function : enviro_check
# usage : enviro_check
# purpose : check if the shell is proper
enviro_check() {
debug_msg "enviro_check ($@)"
if [ -z $LUNAR_INSTALL ]; then
if [ -z "$SHELL" ] || [ "$(getent passwd $USER | cut -d: -f3)" != "0" ] ; then
message "${PROBLEM_COLOR}WARNING:${DEFAULT_COLOR}${MESSAGE_COLOR}" \
"You are not running a fully initialized root shell, consider"
message "running a proper root shell with 'su -'" \
"${DEFAULT_COLOR}"
fi
fi
}
# function : root_check
# usage : root_check
# purpose : check if the user is root
root_check() {
debug_msg "root_check ($@)"
if [ "$UID" != "0" ] ; then
message "${PROBLEM_COLOR}ERROR:${DEFAULT_COLOR}${MESSAGE_COLOR}" \
"User must have root privileges to run this program" \
"${DEFAULT_COLOR}"
exit 1
fi
}
# function : set_priority
# usage : set_priority
# purpose : force niceness on lunar's processes
set_priority() {
debug_msg "set_priority ($@)"
LUNAR_PRIORITY=${LUNAR_PRIORITY:-"+10"}
renice "$LUNAR_PRIORITY" -p $$ 2> /dev/null >/dev/null
}
Jump to Line
Something went wrong with that request. Please try again.