介绍

介绍

我认为我的需求并不那么独特。我有一个有线和无线网络,其中有多台设备运行 Ubuntu 16.04.6 LTS。不过它们很​​快就会升级到 20.04。我希望将每台设备都设置为客户端服务器连接到所有其他设备。目前我有:

  • 戴尔 Inspiron 17R SE 7720 笔记本电脑
  • 戴尔 Alienware 17R3 笔记本电脑
  • 两台机器上的用户名相同

我正在寻找一个可以在两台机器上安装和配置sshopenssh-client同时安装和配置的脚本。这假设包括客户端和服务器。openssh-serverssh

该脚本将:

  1. 如果已安装则删除ssh。(我想这可能没有必要......)
  2. 安装ssh并触发sshd运行systemd
  3. /etc/hosts在或/etc/resolve或任何需要网络名称的地方为机器命名。
  4. 在设置静态 IP 的地方设置静态 IP。
  5. 在设置密钥的任何地方创建密钥。
  6. 阻止对任何不在 LAN 上的设备的访问。
  7. 自动防止窥探或欺骗或任何sp需要防止的行为。
  8. 将当前计算机设置为 LAN 上所有其他计算机(也是服务器)的有效客户端。可能涉及复制 SSH 客户端密钥。
  9. 询问 Ubuntu 问答:远程连接时自动更改终端颜色?

按照互联网文章的要求完成其他所有操作:

调用脚本应该很简单:

sudo ssh-setup HOST_NAME USER_NAME

再次,这台机器既是服务器又是客户端。最初我只有两台笔记本电脑。稍后我想添加基于 Linux 内核的手机和运行 Android 的电视。最初所有机器都只有一个用户 ID。

是否已有脚本了或者我是否必须自己编写?


2020 年 6 月 13 日更新

我已经开始写剧本但至少需要一周时间才能完成。

答案1

介绍

我的最终脚本 ( ssh-setup) 已完成,SSH Open Server 已安装。该脚本的功能不如最初设想的那么多。不过,有人可以拿来修改,以便在大型组织中实现自动设置。希望它能为其他人提供有用的详细信息,帮助安装。

在提出有关 MAC 地址的疑虑之前,请注意:

说:

MAC 地址几乎总是只在“内部”使用(在您和您直接的网关之间)。它们实际上不会传到外部世界,因此无法用于连接您、定位您或对您造成任何直接伤害。


ssh-setup示例输出

$ sudo ssh-setup

Gathering system details - Will take 15 - 30 seconds
 
==========  systemctl status net*  ============================================
 
* network-online.target - Network is Online
      (... OUTPUT SNIPPED TO SAVE SPACE ...)
* networking.service - Raise network interfaces
      (... OUTPUT SNIPPED TO SAVE SPACE ...)
* network.target - Network
      (... OUTPUT SNIPPED TO SAVE SPACE ...)
* network-pre.target - Network (Pre)
      (... OUTPUT SNIPPED TO SAVE SPACE ...)
 
==========  systemctl status ssh  =============================================
 
* ssh.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)
 
==========  [[ -d ~/.ssh ]] && SSH_Keys=$(ls -al ~/.ssh)  =====================
 
-rw-------  1 rick rick 1679 Oct  8  2019 id_rsa
-rw-r--r--  1 rick rick  392 Oct  8  2019 id_rsa.pub
-rw-r--r--  1 rick rick 1108 Jun 17 20:53 known_hosts
 
==========  apt list 2>/dev/null | grep ssh | grep installed  =================
 
libssh-4/xenial-updates,xenial-security,now 0.6.3-4.3ubuntu0.5 amd64
libssh-gcrypt-4/xenial-updates,xenial-security,now 0.6.3-4.3ubuntu0.5 amd64
libssh2-1/xenial-updates,xenial-security,now 1.5.0-2ubuntu0.1 amd64
openssh-client/xenial-updates,xenial-security,now 1:7.2p2-4ubuntu2.8 amd64
sshfs/xenial,now 2.5-1ubuntu1 amd64
 
==========  cat /etc/ssh/sshd.config  =========================================
 

 
==========  ifconfig -a | grep -v ^' ' -A1  ===================================
 
enp59s0   Link encap:Ethernet  HWaddr 28:f1:0e:2a:1a:ed  
          inet addr:192.168.0.12  Bcast:192.168.0.255  Mask:255.255.255.0

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0

wlp60s0   Link encap:Ethernet  HWaddr 9c:b6:d0:10:37:f7  
          inet addr:192.168.0.10  Bcast:192.168.0.255  Mask:255.255.255.0
 
==========  nmap -sn 192.168.0/24  ============================================
 

hitronhub.home (192.168.0.1) (0.0011s latency). MAC: AC:20:2E:CC:94:52 (Unknown)
dell (192.168.0.13) (0.00026s latency). MAC: 5C:F9:DD:5C:9C:53 (Dell)
dell (192.168.0.14) (0.00026s latency). MAC: 5C:F9:DD:5C:9C:53 (Dell)
hs100 (192.168.0.15) (-0.078s latency). MAC: 50:D4:F7:EB:41:35 (Unknown)
android-47cdabb50f83a5ee (192.168.0.16) (-0.076s latency). MAC: 18:4F:32:8D:AA:97 (Hon Hai Precision Ind.)
192.168.0.254 (0.00045s latency). MAC: 00:05:CA:00:00:09 (Hitron Technology)
alien (192.168.0.10) LOCAL NETWORK CARD
alien (192.168.0.12) LOCAL NETWORK CARD

                          
==========  lshw -c network | grep -Ei 'description|product|serial'  ==========
 
Ethernet interface: Killer E2400 Gigabit Ethernet Controller - 28:f1:0e:2a:1a:ed
Wireless interface: QCA6174 802.11ac Wireless Network Adapter - 9c:b6:d0:10:37:f7
 
==========  cat /etc/hosts | grep 192.168  ====================================
 
192.168.0.10    alien  AW 17R3 WiFi                   9c:b6:d0:10:37:f7
192.168.0.12    alien  AW 17R3 Ethernet               28:f1:0e:2a:1a:ed
192.168.0.13    dell   Inspiron 17R-SE-7720 Ethernet  5c:f9:dd:5c:9c:53
192.168.0.14    dell   Inspiron 17R-SE-7720 WiFi      60:6c:66:86:de:bd
192.168.0.15    hs100  Sony TV Wall Light
192.168.0.16    android-47cdabb50f83a5ee  Sony Bravia TV KBL 50W800C
 
==========  FIREWALL: ufw status verbose  =====================================
 
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
-------------- Any error messages below are coming from tlp-stat --------------
cat: /sys/class/power_supply/hidpp_battery_35/present: No such file or directory
cat: /sys/class/power_supply/hidpp_battery_36/present: No such file or directory
 
==========  tlp-stat | grep -E '^autosuspend|ENABLE|WOL'  =====================
 
TLP_ENABLE=1
WOL_DISABLE=Y
autosuspend        = enabled
 
==========  cat /etc/default/halt  ============================================
 
# Default behaviour of shutdown -h / halt. Set to "halt" or "poweroff".
HALT=poweroff
 
==========  cat /etc/network/interfaces  ======================================
 
# interfaces(5) file used by ifup(8) and ifdown(8)
# /etc/network/interfaces
# For Ubuntu 16.04 ONLY according to notes in ssh-setup
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.0.10
        netmask 255.255.255.0
        gateway 192.168.0.1
        dns-nameservers 192.168.0.1
        up ethtool -s eth0 wol g
 
==========  nmcli -p connection show  =========================================
 
====================================================================================
                         NetworkManager connection profiles
====================================================================================
NAME                UUID                                  TYPE             DEVICE  
------------------------------------------------------------------------------------
XXXX-XXXXXX-5G      cf8fda92-0e59-4d0e-8821-cedb4be10d26  802-11-wireless  wlp60s0 
Wired connection 1  378122bb-ad44-3ddd-a616-c93e1bf0f828  802-3-ethernet   enp59s0 
XXXXXXXXX-5G        73c40a50-0f2e-431c-b12c-e4712b3abdb4  802-11-wireless  --      
 
==========  ifconfig -a | grep ^'e' | cut -d' ' -f1  ==========================
 
Ethernet Interface that could be used for WOL:   enp59s0
 
==========  ethtool enp59s0 | grep -i 'Wake-on:'  =============================
 

 
==========  END OF REPORT  ====================================================

虽然报告已经很长了,但如果对每个部分都加以解释,报告还可以变得更长。解释(包括链接)都在实际脚本中。


ssh-setupBash 脚本

必须使用sudo权限调用脚本。相同的脚本设计为在服务器和客户端上运行。/etc/hosts运行报告后,您需要设置某些文件,然后在机器之间复制(可能通过电子邮件)。

在目录中创建脚本后,请记住使用以下命令将其标记为可执行文件:

chmod a+x /path/to/ssh-setup

sudo /path/to/ssh-setup然后使用或调用脚本ssh-setup(如果/path/to/在您的PATH环境变量中)。其中:/path/to/是您在其中创建脚本的文件夹。

#!/bin/bash

# NAME: ssh-setup
# PATH: /mnt/e/bin
# DESC: Display network details needed to setup SSH or debug after setup.
# CALL: Called from terminal with `sudo` permissions.
# DATE: June 18, 2020. Modified: Original Version.

# NOTE: When debugging script place terminal results in appropriate sections.

# From: https://askubuntu.com/questions/628383/output-only-mac-address-on-ubuntu#comment892989_628387

export LANG=C       # Force english names for sed search. For example in
                    # another language HWaddr is direcciónHW

if [[ $(id -u) != 0 ]]; then # root powers needed to call this script
    echo >&2 "'$(basename $0)' must be called with 'sudo'"
    exit 1
fi

# Must have the nmap package.
command -v nmap >/dev/null 2>&1 || { echo >&2 \
        "'nmap' package required but it is not installed.  Aborting."; \
        exit 2; }

# Must have the lshw package.
command -v lshw >/dev/null 2>&1 || { echo >&2 \
        "'lshw' package required but it is not installed.  Aborting."; \
        exit 3; }

# OTHER PACKAGES CONSIDERED AND REJECTED:

# $ network-test
# The program 'network-test' is currently not installed. You can install it
# by typing: 'sudo apt install ifupdown-extra'
# Seems kind of lame and has md5 checksum error.

# $ netstat | wc -l
# 824
# Way to many lines to make use of. Might be good to track down specific addy.

# $ iwconfig
# wlp60s0   IEEE 802.11  ESSID:"XXXXXXXXXXXXXX"  
#           Mode:Managed  Frequency:5.22 GHz  Access Point: AE:20:2E:CC:94:50   
#           Bit Rate=6 Mb/s   Tx-Power=23 dBm
# Reveals router name (EESID) which is bad for neighbours to know us by....

echo
echo "Gathering system details - Will take 15 - 30 seconds"

Display () {

# $1 = command that was run (sometimes abridged version if lots of seds)
# $2 = output from command

echo " "
String1="==========  $1  "
String2="====================================================================="
String3="$String1$String2"
echo "${String3:0:79}"
echo " "
echo "$2"

} # Display

# What systemd network services are running?
NET_Service="" # Default no directory
NET_Service=$(systemctl status net*)
Display 'systemctl status net*' "$NET_Service"

: <<'END'
/* ------------ RESULTS -------------------------------------------------------

(ABRIDGED)

* network-online.target - Network is Online
* networking.service - Raise network interfaces
* network.target - Network
* network-pre.target - Network (Pre)
 
---------------------------------------------------------------------------- */
END
# Is SSH systemd service (aliased as sshd) running?
SSH_Service="" # Default no directory
SSH_Service=$(systemctl status ssh)
Display 'systemctl status ssh' "$SSH_Service"

: <<'END'
/* ------------ RESULTS -------------------------------------------------------

● ssh.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

---------------------------------------------------------------------------- */
END

# What SSH keys are already setup?
SSH_Keys="" # Default no directory
[[ -d ~/.ssh ]] && SSH_Keys=$(ls -al ~/.ssh | \
                              grep -v ^total | \
                              grep -v ^d )
                              # remove total line, ./ and ../ directories
Display '[[ -d ~/.ssh ]] && SSH_Keys=$(ls -al ~/.ssh)' "$SSH_Keys"

: <<'END'
/* ------------ RESULTS -------------------------------------------------------

id_rsa
id_rsa.pub
known_hosts

---------------------------------------------------------------------------- */
END

# What SSH packages are currently installed?
SSH_Installed="" # Default no SSH packages
SSH_Installed=$(apt list 2>/dev/null | grep ssh | grep installed | \
                     sed 's/ \[installed.*//')
                     # remove [installed] & [installed, automatic] strings

Display "apt list 2>/dev/null | grep ssh | grep installed" "$SSH_Installed"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

libssh-4/xenial-updates,xenial-security,now 0.6.3-4.3ubuntu0.5 amd64
libssh-gcrypt-4/xenial-updates,xenial-security,now 0.6.3-4.3ubuntu0.5 amd64
libssh2-1/xenial-updates,xenial-security,now 1.5.0-2ubuntu0.1 amd64
openssh-client/xenial-updates,xenial-security,now 1:7.2p2-4ubuntu2.8 amd64
sshfs/xenial,now 2.5-1ubuntu1 amd64

---------------------------------------------------------------------------- */
END

# What is the SSH configuration?
SSH_Config="" # Default no SSH packages
[[ -f ~/etc/ssh/sshd.config ]] && SSH_Config=$(cat ~/etc/ssh/sshd.config)
Display "cat /etc/ssh/sshd.config" "$SSH_Config"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------
---------------------------------------------------------------------------- */
END

# What IP address are on this machine?
LOCAL_IP_Addresses="" # Default machine has no network cards
LOCAL_IP_Addresses=$(ifconfig -a | grep -v ^' ' -A1 | \
                     grep -v '\-\-')
                     # grep to -v to remove extra lines
Display "ifconfig -a | grep -v ^' ' -A1" "$LOCAL_IP_Addresses"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

enp59s0   Link encap:Ethernet  HWaddr 28:f1:0e:2a:1a:ed  
          inet addr:192.168.0.12  Bcast:192.168.0.255  Mask:255.255.255.0

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0

wlp60s0   Link encap:Ethernet  HWaddr 9c:b6:d0:10:37:f7  
          inet addr:192.168.0.10  Bcast:192.168.0.255  Mask:255.255.255.0
 
---------------------------------------------------------------------------- */
END

# What IP address (potential servers/clients) are visible on network?
NET_IP_Addresses="" # Default LAN is not running
NET_IP_Addresses=$(nmap -sn 192.168.0/24 | \
                   sed '/^Starting Nmap/d' | \
                   sed '/^Nmap done/d' | \
                   sed -z 's/Nmap scan report for //g' | \
                   sed -z 's/\nHost is up\./ LOCAL NETWORK CARD/g' | \
                   sed -z 's/\nHost is up / /g' | \
                   sed -z 's/\nMAC Address: / MAC: /g' )
#                   sed 's/MAC.*(/(/g') # MAC makes line too long
                   # Use sed to remove line breaks making results lengthy
Display "nmap -sn 192.168.0/24" "$NET_IP_Addresses"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

hitronhub.home (192.168.0.1) (0.00072s latency). (Unknown)
dell (192.168.0.13) (0.00021s latency). (Dell)
dell (192.168.0.14) (0.00022s latency). (Dell)
hs100 (192.168.0.15) (0.010s latency). (Unknown)
android-47cdabb50f83a5ee (192.168.0.16) (0.0093s latency). (Hon Hai Precision Ind.)
192.168.0.254 (-0.100s latency). (Hitron Technology)
alien (192.168.0.10) LOCAL NETWORK CARD
alien (192.168.0.12) LOCAL NETWORK CARD

---------------------------------------------------------------------------- */
END

#What network cards are installed:
NetworkCards="" # Contents of /etc/hosts should contain all IP addresses on LAN
NetworkCards=$(lshw -c network | grep -Ei 'description|product|serial' | \
               sed 's/       description: //g' |  \
               sed -z 's/\n       product: /: /g' | \
               sed -z 's/\n       serial: / - /g')
Display "lshw -c network | grep -Ei 'description|product|serial'" "$NetworkCards"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

Ethernet interface: Killer E2400 Gigabit Ethernet Controller - 28:f1:0e:2a:1a:ed
Wireless interface: QCA6174 802.11ac Wireless Network Adapter - 9c:b6:d0:10:37:f7
 
---------------------------------------------------------------------------- */
END

# Email /etc/hosts file to yourself and update contents below on machine
STATIC_IP_Addresses="" # Contents of /etc/hosts should contain all IP addresses on LAN
STATIC_IP_Addresses=$(cat /etc/hosts | grep 192.168)
Display "cat /etc/hosts | grep 192.168" "$STATIC_IP_Addresses"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

192.168.0.10    alien  AW 17R3 WiFi                   9c:b6:d0:10:37:f7
192.168.0.12    alien  AW 17R3 Ethernet               28:f1:0e:2a:1a:ed
192.168.0.13    dell   Inspiron 17R-SE-7720 Ethernet  5c:f9:dd:5c:9c:53
192.168.0.14    dell   Inspiron 17R-SE-7720 WiFi      60:6c:66:86:de:bd
192.168.0.15    hs100  Sony TV Wall Light
192.168.0.16    android-47cdabb50f83a5ee  Sony Bravia TV KBL 50W800C


---------------------------------------------------------------------------- */
END

# Firewall
# Selecteend TLP stats that might prove helpful for debuggin.
ufw_stats="" # Contents of /etc/hosts should contain all IP addresses on LAN
ufw_stats=$(ufw status verbose)
Display "FIREWALL: ufw status verbose" "$ufw_stats"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
-------------- Any error messages below are coming from tlp-stat --------------
cat: /sys/class/power_supply/hidpp_battery_23/present: No such file or directory
cat: /sys/class/power_supply/hidpp_battery_24/present: No such file or directory

---------------------------------------------------------------------------- */
END

echo -------------- \
Any error messages below are coming from tlp-stat --------------
# Selected TLP stats that might prove helpful for debuggin.
TLP_stats="" # Contents of /etc/hosts should contain all IP addresses on LAN
command -v tlp-stat >/dev/null 2>&1 && \
    TLP_stats=$(tlp-stat | grep -E '^autosuspend|ENABLE|WOL')
Display "tlp-stat | grep -E '^autosuspend|ENABLE|WOL'" "$TLP_stats"
: <<'END'

/* ------------ RESULTS -------------------------------------------------------

TLP_ENABLE=1
WOL_DISABLE=Y
autosuspend        = enabled

---------------------------------------------------------------------------- */
END

: <<'END'
/* ------------------  WOL (Wake On LAN) General Comments  --------------------

*******************  UBUNTU 16.04  *******************

From: https://askubuntu.com/questions/764158/
      how-to-enable-wake-on-lan-wol-in-ubuntu-16-04

Also:  http://manpages.ubuntu.com/manpages/xenial/man8/NetworkManager.8.html

In Ubuntu 16.04 set WOL_DISABLE=N in /etc/default/tlp to avoid getting WOL 
disabled by TLP power management.

http://linrunner.de/en/tlp/docs/tlp-configuration.html

Add NETDOWN=no in /etc/default/halt to prevent powering off the network
card during shutdown

Enable Wake on LAN in /etc/network/interfaces when static network 
configuration is used.

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface

auto lo
iface lo inet loopback
# The primary network interface

auto eth0
iface eth0 inet static
        address 192.168.0.10
        netmask 255.255.255.0
        gateway 192.168.0.1
        dns-nameservers 192.168.0.1
        up ethtool -s eth0 wol g

Enable wake on lan in BIOS, enter the BIOS setup and look for something
called "Wake up on PCI event", "Wake up on LAN" or similar. Change it so
that it is enabled. Save your settings and reboot.

https://help.ubuntu.com/community/WakeOnLan

Warning some motherboards / network controllers don't support WOL from the
cold boot (S5 state, where the power to the system is physically turned off 
and back on again). In that case, at least one power cycle (power up, 
shutdown) has to be performed. To mitigate to the problem, the BIOS can be 
configured to power up when AC is restored and schedule a shutdown inside 
Ubuntu afterwards. Refer to the motherboard's manual for further details.


*******************  UBUNTU 18.04  *******************


NOTE: In Ubuntu 18.04 /etc/network/interfaces maybe DEPRECATED
      You might have to create your own script for WOL in:
      /etc/NetworkManager/dispatcher.d/99-Xxxxxx
      
      See: https://askubuntu.com/a/1111656/307523
           https://wiki.archlinux.org/index.php/
           NetworkManager#Network_services_with_NetworkManager_dispatcher


---------------------------------------------------------------------------- */
END

# WOL from: https://wiki.debian.org/WakeOnLan
# apt install ethtool
# ethtool -s eth0 wol g

# Above is NOT PERSISTENT across suspend/resume cycle so issue upon resume
# not just boot. /etc/network/interfaces above has setup.

# Archwiki: https://wiki.archlinux.org/index.php/Wake-on-LAN
# apt install wakeonlan
# wol target_MAC_address

# From: https://www.thegeekstuff.com/2008/11/
# wol-wakeonlan-guide-remotely-turn-on-servers-without-physical-access/
# wakeonlan 5c:f9:dd:5c:9c:53

# Do we have 'NETDOWN=no' line present for machines that shutdown"?
HaltConfig="" # Default no file
[[ -f /etc/default/halt ]] && HaltConfig=$(cat /etc/default/halt)
Display 'cat /etc/default/halt' "$HaltConfig"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

# Default behaviour of shutdown -h / halt. Set to "halt" or "poweroff".
HALT=poweroff

---------------------------------------------------------------------------- */
END

# Do we have static IP addresses setup?
NetworkInterfaces="" # Default no file
[[ -f /etc/network/interfaces ]] && NetworkInterfaces=$(cat /etc/network/interfaces)
Display 'cat /etc/network/interfaces' "$NetworkInterfaces"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

# interfaces(5) file used by ifup(8) and ifdown(8)
# /etc/network/interfaces
# For Ubuntu 16.04 ONLY according to notes in ssh-setup
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.0.10
        netmask 255.255.255.0
        gateway 192.168.0.1
        dns-nameservers 192.168.0.1
        up ethtool -s eth0 wol g

---------------------------------------------------------------------------- */
END

# Hide your router address below if publishing!
nmcliConnections="" # Default no file
nmcliConnections=$(nmcli -p connection show)
Display 'nmcli -p connection show' "$nmcliConnections"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

====================================================================================
                         NetworkManager connection profiles
====================================================================================
NAME                UUID                                  TYPE             DEVICE  
------------------------------------------------------------------------------------
Xxxx-Xxxxxx-Xx      cf8fda92-0e59-4d0e-8821-cedb4be10d26  802-11-wireless  wlp60s0 
Wired connection 1  378122bb-ad44-3ddd-a616-c93e1bf0f828  802-3-ethernet   enp59s0 
Xxxxxxxxx-5G        73c40a50-0f2e-431c-b12c-e4712b3abdb4  802-11-wireless  --      

---------------------------------------------------------------------------- */
END

EthernetInterface=$(ifconfig -a | grep ^'e' | cut -d' ' -f1)
Display "ifconfig -a | grep ^'e' | cut -d' ' -f1" \
"Ethernet Interface that could be used for WOL:   $EthernetInterface"
: <<'END'
/* ------------ RESULTS -------------------------------------------------------

Ethernet Interface that could be used for WOL:   enp59s0

---------------------------------------------------------------------------- */
END

# What WOL_Settings exist for Ethernet Interface?
WOL_Setting="'ethtool' not installed."
command -v ethtool >/dev/null 2>&1 && \
    WOL_Setting="$(ethtool $EthernetInterface | grep -i 'Wake-on:')"
Display "ethtool $EthernetInterface | grep -i 'Wake-on:'" "$WOL_Setting"
: <<'END'

/* ------------ RESULTS -------------------------------------------------------

Supports Wake-on: pumbag
Wake-on: g

---------------------------------------------------------------------------- */
END

Display 'END OF REPORT' ""

## TEST STUFF

#Spare:
: <<'END'
/* ------------ RESULTS -------------------------------------------------------
---------------------------------------------------------------------------- */
END

相关内容