aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/functions
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2007-08-14 13:32:33 +0000
committerHarald Hoyer <harald@redhat.com>2007-08-14 13:32:33 +0000
commit34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce (patch)
tree15c26a89968427a1412775407f4a2754f47dc4d0 /rc.d/init.d/functions
parent55979ee4122d9f5d5e5031f2d9b6f14535047171 (diff)
downloadinitscripts-34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce.tar
initscripts-34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce.tar.gz
initscripts-34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce.tar.bz2
initscripts-34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce.tar.xz
initscripts-34e5bec0a0a37ecbdf40923c79afaa17cdbcdfce.zip
- added support for cryptsetup-uuids (bug #242078)
Diffstat (limited to 'rc.d/init.d/functions')
-rwxr-xr-xrc.d/init.d/functions21
1 files changed, 21 insertions, 0 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 25b9d1e2..8e76c6d7 100755
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -71,6 +71,27 @@ 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 ));
+}
+
# __umount_loop awk_program fstab_file first_msg retry_msg umount_args
# awk_program should process fstab_file and return a list of fstab-encoded
# paths; it doesn't have to handle comments in fstab_file.