Advertisement
mech_coder

script_print_network_configs

Aug 13th, 2015
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. cfg_vars=(
  4. '/etc/resolv.conf'
  5. '/etc/network/interfaces'
  6. '/etc/wpa_supplicant/wpa_supplicant-wlan0.conf'
  7. '/etc/systemd/network/00-wireless-dhcp.network'
  8. '/etc/systemd/system/network-wireless@.service'
  9. '/etc/wpa_supplicant/kill_wpa.sh'
  10. '/etc/nsswitch.conf'
  11. '/etc/sysctl.conf'
  12. )
  13.  
  14. # Print File List
  15. printf "FILE LIST:\n"
  16. let pt=0
  17. while [ -n ""${cfg_vars[$pt]} ]
  18. do
  19. printf '\t%s\n' "${cfg_vars[$pt]}"
  20. let pt=$pt+1
  21. done
  22. printf '(end)\n\n'
  23.  
  24. printf "FILE CONTENTS:\n\n"
  25. let pt=0
  26. while [ -n ""${cfg_vars[$pt]} ]
  27. do
  28. echo "## START FILE: "${cfg_vars[$pt]}
  29. printf '\n'
  30. cat ${cfg_vars[$pt]}
  31. echo "## END FILE: "${cfg_vars[$pt]}
  32. printf '\n\n'
  33. let pt=$pt+1
  34. done
  35. printf '(end)\n\n'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement