-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcdebug.sh
More file actions
30 lines (28 loc) · 796 Bytes
/
cdebug.sh
File metadata and controls
30 lines (28 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
ln -sf /proc/$$/root/bin /proc/1/root/.cdebug
bin_created=False
lib_created=False
lib64_created=False
if [ ! -e proc/1/root/bin ] ; then
ln -sf /proc/$$/root/bin /proc/1/root/bin
bin_created=True
fi
if [ ! -e proc/1/root/lib ] ; then
ln -sf /proc/$$/root/lib /proc/1/root/lib
lib_created=True
fi
if [ ! -e proc/1/root/lib64 ] ; then
ln -sf /proc/$$/root/lib64 /proc/1/root/lib64
lib64_created=True
fi
export PATH=$PATH:/.cdebug
chroot /proc/1/root ash -c "echo 'content of /var/www/html/ :'; ls -laF /var/www/html/; echo 'content of $(pwd) :' ;ls -laF; ash"
if [ $bin_created = True ] ; then
rm /proc/1/root/bin
fi
if [ $lib_created = True ] ; then
rm /proc/1/root/lib
fi
if [ $lib64_created = True ] ; then
rm /proc/1/root/lib64
fi
rm /proc/1/root/.cdebug