dispvm: simplify DispVM preparation script

This commit is contained in:
Marek Marczykowski-Górecki 2014-01-21 04:40:22 +01:00
parent 8dda7cf884
commit 7a639911f8

View File

@ -1,15 +1,15 @@
#!/bin/bash #!/bin/bash
set -o pipefail
get_encoded_script() get_encoded_script()
{ {
if [ "$1" == "vm-default" ]; then ENCODED_SCRIPT=`
SCRIPT_CMD="echo /usr/lib/qubes/dispvm-prerun.sh" if [ "$1" == "vm-default" ]; then
elif ! [ -f "$1" ] ; then echo /usr/lib/qubes/dispvm-prerun.sh
echo $1 is not a file ? else
exit 1 cat "$1"
else fi | base64 -w0` || exit 1
SCRIPT_CMD="cat $1"
fi
ENCODED_SCRIPT=`$SCRIPT_CMD | perl -e 'use MIME::Base64 qw(encode_base64); local($/) = undef;print encode_base64(<STDIN>)'|tr -d "\n"`
} }
if [ $# != 2 -a $# != 3 ] ; then if [ $# != 2 -a $# != 3 ] ; then