summaryrefslogblamecommitdiffstats
path: root/packager/openslx
blob: 6845f9baf2c0de220ee9c71fdf92f3c148cc23ec (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12


                                                                                








                                                                                
                                          



                                                                                
                                           


                                           
                                                                     

                                                                         
 

                             
              

                                                                
              

  
            
                                           
 
             
              

                       
              
 
      
#!/bin/bash
# ------------------------------------------------------------------------------
#
#                        OpenSLX Toolkit Next Gen
#
# ------------------------------------------------------------------------------
#
# The next generation toolkit to build a stateless linux system bootable
# over the network. Composed of dracut-built initramfs and a full system clone.
#
# ------------------------------------------------------------------------------
#
#                                Main Code
#
# ------------------------------------------------------------------------------

declare -rg ARG0="$0"
declare -rg SELF="$(readlink -f "${ARG0}")"
declare -rg ROOT_DIR="$(dirname "${SELF}")"
declare -rg SELF_PID="$$"

# let's keep it simple for now, just source our config/functions file
. "${ROOT_DIR}/${ARG0}".functions || perror "Could not source functions."
. "${ROOT_DIR}/${ARG0}".config || perror "Could not source config."

# root check
if [ "$(id -u)" -ne 0 ]; then
	banner
	perror "ERROR: You need to be root to use this toolkit."
else
	banner
fi

# setup trap
trap do_cleanup SIGINT SIGTERM SIGUSR1 EXIT

# read params
read_params $@

# react to given action
process_action

exit 0