Update main.sh

This commit is contained in:
myvesta 2021-02-08 18:34:57 +01:00 committed by GitHub
parent 7f9105e8ea
commit 19ca71e8fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -299,6 +299,20 @@ is_dir_symlink() {
fi fi
} }
# Check if file exists
if_file_exists() {
if [[ -f "$1" ]]; then
check_result $E_FORBIDEN "$1 file exists"
fi
}
# Check if directory exists
if_dir_exists() {
if [[ -d "$1" ]]; then
check_result $E_FORBIDEN "$1 directory exists"
fi
}
# Get object value # Get object value
get_object_value() { get_object_value() {
object=$(grep "$2='$3'" $USER_DATA/$1.conf) object=$(grep "$2='$3'" $USER_DATA/$1.conf)