3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-28 23:09:39 +01:00
pbot/applets/pbot-vm/host/lib/Languages/sh.pm
Pragmatic Software 17b69f04ff
pbot-vm: massive refactor
* replace heartbeat with health-check
  * instead of steady stream of newlines every 5s, now awaits input
    and responds with `vmstat` output

* more reliably use host/config/vm-exec.json to get libvirt domain name
  for snapshot-revert, server address, serial ports, vagrant setting, etc

* use iptables/nftables to disable networking
  * added guest/bin/disable-network-[iptables,nftables]
  * added guest/bin/enable-network-[iptables,nftables]

* replace ugly ___OUTPUT___ texts in sh, bash, ksh, zsh languages

* documentation updates and tweaks
2024-04-10 01:21:18 -07:00

28 lines
644 B
Perl
Executable File

#!/usr/bin/env perl
# SPDX-FileCopyrightText: 2021-2024 Pragmatic Software <pragma78@gmail.com>
# SPDX-License-Identifier: MIT
use warnings;
use strict;
package Languages::sh;
use parent 'Languages::_default';
sub initialize {
my ($self, %conf) = @_;
$self->{sourcefile} = 'prog.sh';
$self->{execfile} = 'prog.sh';
$self->{default_options} = '';
$self->{cmdline} = 'sh $options $sourcefile';
$self->{cmdline_opening_comment} = ": <<'CMDLINE'\n";
$self->{cmdline_closing_comment} = "CMDLINE\n";
$self->{output_opening_comment} = ": << 'OUTPUT'\n";
$self->{output_closing_comment} = "OUTPUT\n";
}
1;