C:\Windows\System32\wscript.exe ./runhidden.vbs bash -c "export DISPLAY=:0.0; export GDK_DPI_SCALE=1.2; cd ~; exec xfce4-terminal"
' Simple command-line help.
select case WScript.Arguments(0)
case "-?", "/?", "-h", "--help"
WScript.echo "Usage: runHidden executable [...]" & vbNewLine & vbNewLine & "Runs the specified command hidden (without a visible window)."
WScript.Quit(0)
end select
' Separate the arguments into the executable name
' and a single string containing all arguments.
exe = WScript.Arguments(0)
sep = ""
for i = 1 to WScript.Arguments.Count -1
' Enclose arguments in "..." to preserve their original partitioning.
args = args & sep & """" & WScript.Arguments(i) & """"
sep = " "
next
' Execute the command with its window *hidden* (0)
WScript.CreateObject("Shell.Application").ShellExecute exe, args, "", "open", 0
dhclient eth0 eth1 eth2
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
# Internal LAN
auto eth1
iface eth1 inet static
address 192.168.3.1
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255
# The primary network interface
allow-hotplug eth2
iface eth2 inet dhcp
cat > /etc/sysctl.d/10-forwarding.conf
net.ipv4.ip_forward=1
cat > /etc/iptables/rules.v4
# Generated by iptables-save v1.6.0 on Fri Jun 22 11:13:10 2018
*nat
:PREROUTING ACCEPT [2901:568651]
:INPUT ACCEPT [707:80315]
:OUTPUT ACCEPT [445:30025]
:POSTROUTING ACCEPT [14:1200]
-A POSTROUTING -o eth0 -j MASQUERADE
-A POSTROUTING -o eth2 -j MASQUERADE
-A POSTROUTING -o tun+ -j MASQUERADE
COMMIT
# Completed on Fri Jun 22 11:13:10 2018
# Generated by iptables-save v1.6.0 on Fri Jun 22 11:13:10 2018
*filter
:INPUT ACCEPT [57264:68964200]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [44820:7558046]
-A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i eth1 -o tun+ -j ACCEPT
COMMIT
# Completed on Fri Jun 22 11:13:10 2018
cat > /etc/dnsmasq.d/router.conf
dhcp-authoritative
domain-needed
localise-queries
read-ethers
bogus-priv
expand-hosts
local-service
domain=lan
server=/lan/
dhcp-leasefile=/tmp/dhcp.leases
interface=eth1
dhcp-range=lan,192.168.3.100,192.168.3.249,255.255.255.0,12h
Source: https://habr.com/ru/post/429856/
All Articles