dispvm: simplify DispVM preparation script
This commit is contained in:
parent
8dda7cf884
commit
7a639911f8
@ -1,15 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
get_encoded_script()
|
get_encoded_script()
|
||||||
{
|
{
|
||||||
|
ENCODED_SCRIPT=`
|
||||||
if [ "$1" == "vm-default" ]; then
|
if [ "$1" == "vm-default" ]; then
|
||||||
SCRIPT_CMD="echo /usr/lib/qubes/dispvm-prerun.sh"
|
echo /usr/lib/qubes/dispvm-prerun.sh
|
||||||
elif ! [ -f "$1" ] ; then
|
|
||||||
echo $1 is not a file ?
|
|
||||||
exit 1
|
|
||||||
else
|
else
|
||||||
SCRIPT_CMD="cat $1"
|
cat "$1"
|
||||||
fi
|
fi | base64 -w0` || exit 1
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user