mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 21:34:11 -07:00
Improved file manager API functions
This commit is contained in:
parent
7bc8af40f3
commit
15d1f4f4c9
13 changed files with 292 additions and 82 deletions
|
@ -15,20 +15,23 @@ fi
|
|||
|
||||
# Checking vesta user
|
||||
if [ ! -e "$VESTA/data/users/$user" ]; then
|
||||
exit 1
|
||||
echo "Error: vesta user $user doesn't exist"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
# Checking user homedir
|
||||
homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
|
||||
if [ -z $homedir ]; then
|
||||
exit 1
|
||||
echo "Error: user home directory doesn't exist"
|
||||
exit 12
|
||||
fi
|
||||
|
||||
# Checking path
|
||||
if [ ! -z "$path" ]; then
|
||||
rpath=$(readlink -f "$path")
|
||||
if [ -z "$(echo $rpath |grep $homedir)" ]; then
|
||||
exit 1
|
||||
echo "Error: invalid path $dst_dir"
|
||||
exit 2
|
||||
fi
|
||||
else
|
||||
path=$homedir
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue