summaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorMichael Neves2012-01-27 15:03:56 +0100
committerMichael Neves2012-01-27 15:03:56 +0100
commit8e8af091fd55501dcbab42836726cd25a494c077 (patch)
tree1af1be3fa81ca5196f5a7dba0e0df8218bde2cc5 /inc
parentadded boot media type in kcl of preboot environment (diff)
downloadusb-boot-stick-8e8af091fd55501dcbab42836726cd25a494c077.tar.gz
usb-boot-stick-8e8af091fd55501dcbab42836726cd25a494c077.tar.xz
usb-boot-stick-8e8af091fd55501dcbab42836726cd25a494c077.zip
pbs-serials added
Diffstat (limited to 'inc')
-rw-r--r--inc/functions.pbs-serials.sh64
-rw-r--r--inc/functions.pbs.sh74
2 files changed, 138 insertions, 0 deletions
diff --git a/inc/functions.pbs-serials.sh b/inc/functions.pbs-serials.sh
new file mode 100644
index 0000000..844b239
--- /dev/null
+++ b/inc/functions.pbs-serials.sh
@@ -0,0 +1,64 @@
+SHORT_OPTS=":vh"
+LONG_OPTS="version,help"
+
+LOG_DIR="/tmp/pbmtk"
+
+run_module_checks () {
+
+ if [ ! -z $1 ]; then
+ perror "Too many parameters. \n"
+ print_usage
+ exit 1
+ fi
+
+}
+
+init_params () {
+
+}
+
+print_usage() {
+ echo "Usage: $(basename $SELF) pbs-serials [OPTIONS]"
+ echo -e " -h --help \t print help"
+ echo -e " -v --version \t print version information"
+}
+
+read_params() {
+ getopt_start $@
+
+ eval set -- "$GETOPT_TEMP"
+
+ while true ; do
+ case "$1" in
+ -v|--version)
+ echo "OpenSLX PreBoot .. ($VERSION - $VDATE)."
+ exit 0
+ ;;
+ -h|--help)
+ print_usage
+ exit 0
+ ;;
+ --) shift ; break ;;
+ *) perror "Internal error!" ; exit 1 ;;
+ esac
+ done
+}
+
+get_preboot_serials() {
+
+ pinfo "Retrieving Serials..."
+
+ unset_quiet
+ wget -qO- pbs2.mp.openslx.org/resource/getprebootserials/apikey/apikey_uni-freiburg | cat
+ set_quiet
+
+
+}
+
+run () {
+
+ set_quiet
+ get_preboot_serials
+ unset_quiet
+
+} \ No newline at end of file
diff --git a/inc/functions.pbs.sh b/inc/functions.pbs.sh
new file mode 100644
index 0000000..563a39e
--- /dev/null
+++ b/inc/functions.pbs.sh
@@ -0,0 +1,74 @@
+SHORT_OPTS=":vfdh"
+LONG_OPTS="version,force,debug,help"
+
+LOG_DIR="/tmp/pbmtk"
+TMP_DIR=/tmp/openslx-iso
+
+run_module_checks () {
+
+ if [ ! -z $1 ]; then
+ perror "Too many parameters. \n"
+ print_usage
+ exit 1
+ fi
+
+ if [ -z $(which genisoimage) ]; then
+ perror "'genisoimage' is missing (if you are on a debian/ubuntu system: apt-get install genisoimage)"
+ exit 1
+ fi
+}
+
+init_params () {
+ FORCE=0
+ DEBUG=0
+}
+
+print_usage() {
+ echo "Usage: $(basename $SELF) iso [OPTIONS]"
+ echo -e " -d --debug \t give more debug output"
+ echo -e " -f --force \t don't ask questions"
+ echo -e " -h --help \t print help"
+ echo -e " -v --version \t print version information"
+}
+
+read_params() {
+ getopt_start $@
+
+ eval set -- "$GETOPT_TEMP"
+
+ while true ; do
+ case "$1" in
+ -v|--version)
+ echo "OpenSLX PreBoot .. ($VERSION - $VDATE)."
+ exit 0
+ ;;
+ -h|--help)
+ print_usage
+ exit 0
+ ;;
+ -f|--force) pinfo "Disable user-interaction."; FORCE=1; shift ;;
+ -d|--debug) pinfo "Enabled debugmode."; DEBUG=1; unset_quiet; shift ;;
+ --) shift ; break ;;
+ *) perror "Internal error!" ; exit 1 ;;
+ esac
+ done
+}
+
+get_preboot_serials() {
+
+ pinfo "Retrieving Serials..."
+
+ unset_quiet
+ wget -qO- pbs2.mp.openslx.org/resource/getprebootserials/apikey/apikey_uni-freiburg | cat
+ set_quiet
+
+
+}
+
+run () {
+
+ set_quiet
+ get_preboot_serials
+ unset_quiet
+
+} \ No newline at end of file