Skip to content

Instantly share code, notes, and snippets.

@caramelchocolate
Last active July 23, 2019 04:05
Show Gist options
  • Save caramelchocolate/39538bda6e89a14456dd837d98b03d06 to your computer and use it in GitHub Desktop.
Save caramelchocolate/39538bda6e89a14456dd837d98b03d06 to your computer and use it in GitHub Desktop.
collect /usr/local/etc/postfix/main.cf in jail
#!/bin/sh
jls | awk 'NR>1 {print $4}' | awk -F'/' '{print $NF}' | xargs -I@ sh -c 'j=@; c=$(jexec ${j} test -e /usr/local/etc/postfix/main.cf && jexec ${j} cat /usr/local/etc/postfix/main.cf); echo "${c}" > "${j}.txt"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment