Last active
December 17, 2015 23:36
-
-
Save PieterScheffers/1bb0512c0719e67b2e7f to your computer and use it in GitHub Desktop.
FreeBSD - Find updates for programs in jails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# portmaster need to be installed in all jails | |
jls | grep -v JID | tr -s " " | cut -d' ' -f2 | xargs -I {} sh -c 'echo {} && jexec -U root {} portmaster -L | grep New | cut -d: -f2' | |
# jls # list jails | |
# grep -v JID # get all lines without JID in it (-v is negation) | |
# tr -s " " # replace multiple newlines with one | |
# cut -d' ' -f2 # split string on newlines and select part 2 | |
# xargs -I {} sh -c '' # split string on newlines and spaces into argument list, then use {} as argument placeholder, then execute sh -c command | |
# sh -c '' # execute sub-shell with commands in string | |
# echo {} # output argument (placeholder = jailnumber) | |
# jexec -U root {} cmd # execute command in jail | |
# portmaster -L # get list of installed ports | |
# grep New # find lines with 'New' in it | |
# cut -d: -f2 # split string on colon and select part 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment