mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Clarify scripts/local_facts.fact
This commit is contained in:
parent
dd40abd738
commit
0a0f38716a
1 changed files with 8 additions and 3 deletions
|
@ -91,19 +91,24 @@ tmp=$(cat /proc/device-tree/model) &&
|
|||
tmp=$(ansible --version) &&
|
||||
ANSIBLE_VERSION=$(echo $tmp | head -n 1 | cut -f 2 -d " ")
|
||||
|
||||
|
||||
# THESE LAST 3 ARE DIFFEENT as "systemctl is-enabled" unhelpfully returns the
|
||||
# same rerror code (i.e. 1) REGARDLESS whether service is (A) disabled or
|
||||
# (B) doesn't exist. SO WE TEST THE STRING OUTPUT INSTEAD OF THE RETURN CODE.
|
||||
|
||||
tmp=$(systemctl is-enabled dhcpcd)
|
||||
[[ $tmp = "" ]] || DHCPCD=$tmp
|
||||
[[ $tmp != "" ]] &&
|
||||
DHCPCD=$tmp
|
||||
#[[ $tmp ]] && DHCPCD=$tmp # Short Ain't Sweet (less understandable)
|
||||
|
||||
# Debian family only, as is_redhat would use NetworkManager as the service name
|
||||
tmp=$(systemctl is-enabled network-manager)
|
||||
[[ $tmp = "" ]] || NETWORK_MANAGER=$tmp
|
||||
[[ $tmp != "" ]] &&
|
||||
NETWORK_MANAGER=$tmp
|
||||
|
||||
tmp=$(systemctl is-enabled systemd-networkd)
|
||||
[[ $tmp = "" ]] || SYSTEMD_NETWORKD=$tmp
|
||||
[[ $tmp != "" ]] &&
|
||||
SYSTEMD_NETWORKD=$tmp
|
||||
|
||||
|
||||
cat <<EOF
|
||||
|
|
Loading…
Add table
Reference in a new issue