summaryrefslogtreecommitdiff
path: root/adapt-ks-template
diff options
context:
space:
mode:
authorJon Clausen <jac@nordu.net>2018-07-31 10:42:35 +0200
committerJon Clausen <jac@nordu.net>2018-07-31 10:42:35 +0200
commit55282ee15f1eeefc5a68d843003b09a6f2f6da1d (patch)
tree1c10216ac264d70cb7dba451793d5732b5970f7c /adapt-ks-template
parent0cae593ee142c94c77818e5538c82572f8b767c6 (diff)
added support for setting tty+ttyS
Diffstat (limited to 'adapt-ks-template')
-rwxr-xr-xadapt-ks-template22
1 files changed, 21 insertions, 1 deletions
diff --git a/adapt-ks-template b/adapt-ks-template
index 9f7640f..a2026e6 100755
--- a/adapt-ks-template
+++ b/adapt-ks-template
@@ -32,9 +32,11 @@ Options:
--template Template to use. This is a relative path, plus the
name of the template file. Default:
${Template}
+ -h, --help this
--sec-ip IP of secondary interface
--sec-nm Netmask of secondary interface
- -h, --help this
+ --tty console number
+ --ttyS serial console number
EOF
}
@@ -105,6 +107,14 @@ function parse_commadline {
TmpDir="${2}"
shift
;;
+ --tty)
+ tty="${2}"
+ shift
+ ;;
+ --ttyS)
+ ttyS="${2}"
+ shift
+ ;;
*)
echo "what do you mean \"$1\"?"
exit 1
@@ -165,6 +175,14 @@ function check_options {
then
NS="109.106.96.141"
fi
+ if [ "x${tty}" = "x" ]
+ then
+ tty=1
+ fi
+ if [ "x${ttyS}" = "x" ]
+ then
+ ttyS=1
+ fi
}
parse_commadline ${@}
@@ -198,6 +216,8 @@ sed -ie "s/PRIGATEWAY/${GW}/g" "${TmpDir}/ks-template"
sed -ie "s/PRINAMESERVERS/${NS}/g" "${TmpDir}/ks-template"
sed -ie "s/SECIP/${SecIP}/g" "${TmpDir}/ks-template"
sed -ie "s/SECNETMASK/${SecNM}/g" "${TmpDir}/ks-template"
+sed -ie "s/ttyTTY/tty${tty}/g" "${TmpDir}/ks-template"
+sed -ie "s/ttySTTYS/ttyS${ttyS}/g" "${TmpDir}/ks-template"
if [ "x${PublishPath}" = "x" ]
then