Linux ip-172-26-5-244 6.1.0-28-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.119-1 (2024-11-22) x86_64
Apache
: 172.26.5.244 | : 216.73.216.21
Cant Read [ /etc/named.conf ]
8.3.14
daemon
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
opt /
bitnami /
scripts /
[ HOME SHELL ]
Name
Size
Permission
Action
apache
[ DIR ]
drwxr-xr-x
apache-lamp
[ DIR ]
drwxr-xr-x
apache-php-fpm
[ DIR ]
drwxr-xr-x
init
[ DIR ]
drwxr-xr-x
mariadb
[ DIR ]
drwxr-xr-x
php
[ DIR ]
drwxr-xr-x
php-mysql
[ DIR ]
drwxr-xr-x
phpmyadmin
[ DIR ]
drwxr-xr-x
varnish
[ DIR ]
drwxr-xr-x
apache-env.sh
3.48
KB
-rw-r--r--
bitnami-env.sh
414
B
-rw-r--r--
libapache.sh
32.36
KB
-rw-r--r--
libfile.sh
4.29
KB
-rw-r--r--
libfs.sh
4.66
KB
-rw-r--r--
liblog.sh
2.61
KB
-rw-r--r--
libmariadb.sh
46.25
KB
-rw-r--r--
libnet.sh
4.71
KB
-rw-r--r--
libos.sh
15.69
KB
-rw-r--r--
libpersistence.sh
4.6
KB
-rw-r--r--
libphp.sh
7.48
KB
-rw-r--r--
libphpmyadmin.sh
8.94
KB
-rw-r--r--
libservice.sh
14.13
KB
-rw-r--r--
libvalidations.sh
6.62
KB
-rw-r--r--
libvarnish.sh
5.75
KB
-rw-r--r--
libversion.sh
1.42
KB
-rw-r--r--
libwebserver.sh
15.05
KB
-rw-r--r--
mariadb-env.sh
8.47
KB
-rw-r--r--
php-env.sh
3.61
KB
-rw-r--r--
phpmyadmin-env.sh
5.43
KB
-rw-r--r--
varnish-env.sh
3.48
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : libfs.sh
#!/bin/bash # Copyright Broadcom, Inc. All Rights Reserved. # SPDX-License-Identifier: APACHE-2.0 # # Library for file system actions # shellcheck disable=SC1091 # Load Generic Libraries . /opt/bitnami/scripts/liblog.sh # Functions ######################## # Ensure a file/directory is owned (user and group) but the given user # Arguments: # $1 - filepath # $2 - owner # Returns: # None ######################### owned_by() { local path="${1:?path is missing}" local owner="${2:?owner is missing}" local group="${3:-}" if [[ -n $group ]]; then chown "$owner":"$group" "$path" else chown "$owner":"$owner" "$path" fi } ######################## # Ensure a directory exists and, optionally, is owned by the given user # Arguments: # $1 - directory # $2 - owner # Returns: # None ######################### ensure_dir_exists() { local dir="${1:?directory is missing}" local owner_user="${2:-}" local owner_group="${3:-}" [ -d "${dir}" ] || mkdir -p "${dir}" if [[ -n $owner_user ]]; then owned_by "$dir" "$owner_user" "$owner_group" fi } ######################## # Checks whether a directory is empty or not # arguments: # $1 - directory # returns: # boolean ######################### is_dir_empty() { local -r path="${1:?missing directory}" # Calculate real path in order to avoid issues with symlinks local -r dir="$(realpath "$path")" if [[ ! -e "$dir" ]] || [[ -z "$(ls -A "$dir")" ]]; then true else false fi } ######################## # Checks whether a mounted directory is empty or not # arguments: # $1 - directory # returns: # boolean ######################### is_mounted_dir_empty() { local dir="${1:?missing directory}" if is_dir_empty "$dir" || find "$dir" -mindepth 1 -maxdepth 1 -not -name ".snapshot" -not -name "lost+found" -exec false {} +; then true else false fi } ######################## # Checks whether a file can be written to or not # arguments: # $1 - file # returns: # boolean ######################### is_file_writable() { local file="${1:?missing file}" local dir dir="$(dirname "$file")" if [[ (-f "$file" && -w "$file") || (! -f "$file" && -d "$dir" && -w "$dir") ]]; then true else false fi } ######################## # Relativize a path # arguments: # $1 - path # $2 - base # returns: # None ######################### relativize() { local -r path="${1:?missing path}" local -r base="${2:?missing base}" pushd "$base" >/dev/null || exit realpath -q --no-symlinks --relative-base="$base" "$path" | sed -e 's|^/$|.|' -e 's|^/||' popd >/dev/null || exit } ######################## # Configure permisions and ownership recursively # Globals: # None # Arguments: # $1 - paths (as a string). # Flags: # -f|--file-mode - mode for directories. # -d|--dir-mode - mode for files. # -u|--user - user # -g|--group - group # Returns: # None ######################### configure_permissions_ownership() { local -r paths="${1:?paths is missing}" local dir_mode="" local file_mode="" local user="" local group="" # Validate arguments shift 1 while [ "$#" -gt 0 ]; do case "$1" in -f | --file-mode) shift file_mode="${1:?missing mode for files}" ;; -d | --dir-mode) shift dir_mode="${1:?missing mode for directories}" ;; -u | --user) shift user="${1:?missing user}" ;; -g | --group) shift group="${1:?missing group}" ;; *) echo "Invalid command line flag $1" >&2 return 1 ;; esac shift done read -r -a filepaths <<<"$paths" for p in "${filepaths[@]}"; do if [[ -e "$p" ]]; then find -L "$p" -printf "" if [[ -n $dir_mode ]]; then find -L "$p" -type d ! -perm "$dir_mode" -print0 | xargs -r -0 chmod "$dir_mode" fi if [[ -n $file_mode ]]; then find -L "$p" -type f ! -perm "$file_mode" -print0 | xargs -r -0 chmod "$file_mode" fi if [[ -n $user ]] && [[ -n $group ]]; then find -L "$p" -print0 | xargs -r -0 chown "${user}:${group}" elif [[ -n $user ]] && [[ -z $group ]]; then find -L "$p" -print0 | xargs -r -0 chown "${user}" elif [[ -z $user ]] && [[ -n $group ]]; then find -L "$p" -print0 | xargs -r -0 chgrp "${group}" fi else stderr_print "$p does not exist" fi done }
Close