#!/bin/bash # Copyright (C) 2016 Ian Kelling # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # WARNING: outdated! needs docs and update to debian-stretch [[ $EUID == 0 ]] || exec sudo "$BASH_SOURCE" "$@" set -e; . /usr/local/lib/bash-bear; set +e this_file="$(readlink -f -- "${BASH_SOURCE[0]}")" readonly this_file this_dir="${this_file%/*}" e() { echo "$*"; "$@"; } mount_dir=$(mktemp -d) err-cleanup() { cd; umount -f $mount_dir; } e mount -o users cmc:/mnt/usb $mount_dir cd $mount_dir e rm -rf debian-wheezy mkdir debian-wheezy cd debian-wheezy e $this_dir/debian-preseed "$@" # my script cd .. e rm -f tftpboot e ln -s debian-wheezy tftpboot cd / e umount $mount_dir e $this_dir/pxe-server default plain # my script