aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2007-08-29 18:40:42 +0000
committerBill Nottingham <notting@redhat.com>2007-08-29 18:40:42 +0000
commitcf5adc0b4d1c31d083b6bd8c5ccd0d8aa7619ff1 (patch)
tree483829c3fcb7ea80929e1f45e0d4c6d25f876e44
parentb5bd942d49da258a6d84964f3366315e35a2724d (diff)
downloadinitscripts-cf5adc0b4d1c31d083b6bd8c5ccd0d8aa7619ff1.tar
initscripts-cf5adc0b4d1c31d083b6bd8c5ccd0d8aa7619ff1.tar.gz
initscripts-cf5adc0b4d1c31d083b6bd8c5ccd0d8aa7619ff1.tar.bz2
initscripts-cf5adc0b4d1c31d083b6bd8c5ccd0d8aa7619ff1.tar.xz
initscripts-cf5adc0b4d1c31d083b6bd8c5ccd0d8aa7619ff1.zip
make __readlink as simple as possible. Seems to match the /usr/bin
implementation (which does not normalize for full paths)
-rwxr-xr-xrc.d/init.d/functions19
1 files changed, 1 insertions, 18 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 8e76c6d7..5555e8b5 100755
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -71,25 +71,8 @@ checkpid() {
return 1
}
-__basename() {
- echo ${@##*/}
-}
-__dirname() {
- f=$@
- b=$(__basename "$f")
- if [ "$b" = "$f" ]; then
- echo "."
- return
- fi
- d=${f//\/$b/}
- echo $d
-}
-
__readlink() {
- f=$@
- l=$(ls -bl "$f"|(read a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 link rest; echo $link))
- d=$(__dirname "$f")/./$(__dirname $l )
- (cd "$d" ;echo $(pwd -P)/$(__basename $l ));
+ ls -bl "$@" 2>/dev/null| awk '{ print $NF }')
}
# __umount_loop awk_program fstab_file first_msg retry_msg umount_args