Created
September 8, 2019 01:13
-
-
Save shutingrz/76d1910b679ba3b51630a3f382867597 to your computer and use it in GitHub Desktop.
Vitochaイメージのovaをfusionでインポートできるようにしたpainaスクリプト改変版
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ORIGINAL_OVA=${1:-./InternetSim.ova} | |
DESTDIR=${2:-.} | |
tar -C $DESTDIR -xvf $ORIGINAL_OVA | |
cp -ip $DESTDIR/InternetSim.ovf $DESTDIR/InternetSim.ovf_ORG | |
OVF_OLD_SHA1=$(shasum $DESTDIR/InternetSim.ovf_ORG | cut -d" " -f1) | |
sed -i "" 's/ovf:capacity="19326328320"/ovf:capacity="18" ovf:capacityAllocationUnits="GigaBytes"/' $DESTDIR/InternetSim.ovf | |
sed -i "" 's/ovf:capacity="21474836480"/ovf:capacity="20" ovf:capacityAllocationUnits="GigaBytes"/' $DESTDIR/InternetSim.ovf | |
OVF_NEW_SHA1=$(shasum $DESTDIR/InternetSim.ovf | cut -d" " -f1) | |
sed -i "_ORG" "s/$OVF_OLD_SHA1/$OVF_NEW_SHA1/" $DESTDIR/InternetSim.mf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment