-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcreate-netboot
executable file
·41 lines (31 loc) · 1.15 KB
/
create-netboot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
. /etc/grml/sh-lib
SHARED_PROG_VARS_="/usr/share/grml-terminalserver/shared_prog_vars"
isExistent $SHARED_PROG_VARS_ die
. $SHARED_PROG_VARS_
function actionPkg
{
local pwd_="$(pwd)"
local tmp_="$(mktemp -td terminalserver.XXXXXX)" || die "could not create tmpfile"
# version information:
local version_="$(cat /etc/grml_version)"
local version_number_="$(awk '{print $2}' /etc/grml_version)"
case $version_number_ in
[0-9]*) version_="${version_%% *}"_${version_number_} ;;
*) version_="${version_%% *}" ;;
esac
local path_="$tmp_/grml_netboot_package_$version_"
mkdir "$path_"
cp $NETBOOT_PACKAGE_CONF_FILE_ $CONF_FILE_
echo "executing grml-terminalserver-config initrd"
grml-terminalserver-config initrd
# tftpd config
grml-terminalserver config tftp
cp -r $TFTPD_DATA_DIR_ $path_
( cd "$tmp_" && tar jcf "$pwd_"/grml_netboot_package_${version_}.tar.bz2 "grml_netboot_package_$version_" )
rm -rf "$tmp_"
echo "grml_netboot_package_${version_}.tar.bz2 has been created."
}
checkRoot die "You have to be root to use this program"
disableSyslog
actionPkg