add functions.sh
[grml-live.git] / scripts / functions.sh
1 # Filename:      functions.sh
2 # Purpose:       helper functions for use within grml-live
3 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
4 # Bug-Reports:   see http://grml.org/bugs/
5 # License:       This file is licensed under the GPL v2.
6 # Latest change: Thu Feb 08 22:35:46 CET 2007
7 ################################################################################
8
9 bailout(){
10   [ -n "$1" ] && EXIT="$1" || EXIT="1"
11   exit "$EXIT"
12 }
13
14 usage() {
15   print "
16   $0 ....
17 "
18 }
19
20 debug() {
21   if [[ -n "$DEBUG" ]] ; then
22      print "grml-live: $*"
23      [[ -n "$DEBUG_SYSLOG" ]] && [ -x /usr/bin/logger ] && logger -t grml-live "$*"
24   else
25      return 0 # do nothing
26   fi
27 }
28
29 cmdline_options () {
30         while true
31         do
32                 case "${1}" in
33                         (-r|--root) LIVE_ROOT="${2}"
34                                 shift 2 ;;
35                         (-v|--version) usage
36                                 exit 1 ;;
37                         (--) shift
38                                 break ;;
39                         (*) exit 0 ;;
40                 esac
41         done
42 }
43 chroot_exec()
44 {
45 ;
46 }
47
48 ## END OF FILE #################################################################