implement makeNode()

This commit is contained in:
belliash 2012-01-08 23:46:05 +01:00
parent 4344d60083
commit c2244847aa
1 changed files with 15 additions and 0 deletions

View File

@ -89,6 +89,21 @@ function makeLink() {
return ${RESULT}
}
#-------------------------------------------------------------------------------
# Makes block or character special file (wrapper to mknod)
# Parameters: %directory% %name% %type% [%major%] [%minor%]
#-------------------------------------------------------------------------------
function makeNode() {
local DIRECTORY="${1}"
shift
if [ ! -d ${DIRECTORY} ]; then
makeDirectory ${DIRECTORY} || return 1
fi
cd ${DIRECTORY}
run "mknod ${*}" || return 1
return 0
}
#-------------------------------------------------------------------------------
# Extracts any tar based archive into specified directory
# Parameters: %tarball% %dest_directory%