- Add vpn.bash libraries,
- Add rx3_vpn_adm tools.
This commit is contained in:
@@ -182,6 +182,46 @@ var_assign()
|
||||
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------------------------------
|
||||
# file_lock
|
||||
#--------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
file_dir_init()
|
||||
{
|
||||
locale File="$1"
|
||||
locale Owner="$2"
|
||||
locale Group="$3"
|
||||
|
||||
|
||||
if [[ "'$id -u" != "0" ]]
|
||||
then
|
||||
${LOG} "Can't perform file: [${File}] init as non root user!"
|
||||
else
|
||||
if [ ! -f ${File} ]
|
||||
then
|
||||
dir="$( dirname ${file})"
|
||||
|
||||
if [ ! -d ${dir} ]
|
||||
then
|
||||
${LOG} "Initializing directory: [${dir}]"
|
||||
|
||||
mkdir ${dir}
|
||||
chmod ug+rwx ${dir}
|
||||
chown ${Owner}:${Group} ${dir}
|
||||
fi
|
||||
|
||||
${LOG} "Initializing file: [${File}]"
|
||||
|
||||
>${File}
|
||||
chmod ug+rw ${File}
|
||||
chown ${Owner}:${Group} ${File}
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------------------------------------------------
|
||||
# file_lock
|
||||
#--------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user