mirror of
https://github.com/termux/proot.git
synced 2024-11-11 13:49:26 +00:00
17 lines
414 B
Bash
17 lines
414 B
Bash
if [ -z `which mcookie` ] || [ -z `which mkdir` ] || [ -z `which ln` ] || [ -z `which ls` ] || [ -z `which rm` ] || [ -z `which cat` ]; then
|
|
exit 125;
|
|
fi
|
|
|
|
TMP=/tmp/$(mcookie)
|
|
TMP2=/tmp/$(mcookie)
|
|
mkdir ${TMP}
|
|
ln -s /proc/self/fd ${TMP}/fd
|
|
ln -s ${TMP}/fd/0 ${TMP}/stdin
|
|
|
|
${PROOT} \ls ${TMP}/stdin | grep ^${TMP}/stdin$
|
|
|
|
echo OK > ${TMP2}
|
|
${PROOT} cat ${TMP}/stdin < ${TMP2} | grep ^OK$
|
|
|
|
rm -fr ${TMP} ${TMP2}
|