Created
April 25, 2017 21:39
-
-
Save cjohnson496/d86675f6a699e0a494d9034a6602e64f to your computer and use it in GitHub Desktop.
Initial part of script used to copy /bin/bash, /bin/ls, /bin/rpm, along with their libs to JAIL.
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
#!/usr/bin/env bash | |
# Setup JAIL location | |
J=${JAIL:-/var/chroot/jaildir} | |
# For continuity define JAIL var. | |
JAIL=$J | |
mkdir -p $J/{bin,lib64,lib} | |
ls $J | |
cp -afv /bin/{bash,ls,rpm} $J/bin | |
list0="$(ldd /bin/bash | egrep -o '/lib.*\.[0-9]')" | |
for i in $list0; do cp -afv "$i" "${J}${i}"; done | |
list1="$(ldd /bin/ls | egrep -o '/lib.*\.[0-9]')" | |
for i in $list1; do cp -afv "$i" "${J}${i}"; done | |
list2="$(ldd /bin/rpm | egrep -o '/lib.*\.[0-9]')" | |
for i in $list2; do cp -afv "$i" "${J}${i}"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment