24 lines
1.0 KiB
Bash
24 lines
1.0 KiB
Bash
#!/bin/bash
|
|
# Deploy METATRON harness to Commando VM (601)
|
|
set -e
|
|
VMID=601
|
|
DEST='C:\Tools\metatron'
|
|
|
|
qm guest exec $VMID -- cmd /c "if not exist C:\\Tools\\metatron mkdir C:\\Tools\\metatron" >/dev/null
|
|
echo "dir ready"
|
|
|
|
B64=$(base64 -w0 /tmp/metatron.py)
|
|
qm guest exec $VMID -- powershell -NoProfile -Command "[IO.File]::WriteAllText('$DEST\\metatron.py',[Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('$B64')))" >/dev/null
|
|
echo "metatron.py written"
|
|
|
|
B64=$(base64 -w0 /tmp/metatron.bat)
|
|
qm guest exec $VMID -- powershell -NoProfile -Command "[IO.File]::WriteAllText('$DEST\\metatron.bat',[Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('$B64')))" >/dev/null
|
|
echo "metatron.bat written"
|
|
|
|
# add to machine PATH (SYSTEM context)
|
|
qm guest exec $VMID -- powershell -NoProfile -Command "[Environment]::SetEnvironmentVariable('Path',[Environment]::GetEnvironmentVariable('Path','Machine')+';C:\Tools\metatron','Machine')" >/dev/null
|
|
echo "PATH updated"
|
|
|
|
echo "=== verify files ==="
|
|
qm guest exec $VMID -- cmd /c "dir C:\\Tools\\metatron"
|