Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.35
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
bacula-common /
Delete
Unzip
Name
Size
Permission
Date
Action
defconfig
[ DIR ]
drwxr-xr-x
2025-07-14 12:21
common-functions.dpkg
4.43
KB
-rw-r--r--
2018-03-04 12:49
common-functions.init
451
B
-rw-r--r--
2018-03-04 12:49
Save
Rename
# -*-shell-script-*- # # Common functions, used from dpkg scripts # genRandomPassword() { cat /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c33 } readOrCreatePasswords() { BACULAPWFILE=/etc/bacula/common_default_passwords if [ -f $BACULAPWFILE ]; then . $BACULAPWFILE fi if [ -z "$DIRPASSWD" -o -z "$DIRMPASSWD" -o -z "$SDPASSWD" -o \ -z "$SDMPASSWD" -o -z "$FDPASSWD" -o -z "$FDMPASSWD" ] ; then # Create the passwords. DIRPASSWD=`genRandomPassword` DIRMPASSWD=`genRandomPassword` SDPASSWD=`genRandomPassword` SDMPASSWD=`genRandomPassword` FDPASSWD=`genRandomPassword` FDMPASSWD=`genRandomPassword` # Save the passwords. echo "# " > $BACULAPWFILE chown root:root $BACULAPWFILE chmod 0600 $BACULAPWFILE cat >>$BACULAPWFILE <<EOF # This file has been autogenerated during package installation and # holds defaults for new Bacula packages installed on this system. It # is used only when you install a new Bacula package, and can be # safely removed at any time. DIRPASSWD=$DIRPASSWD DIRMPASSWD=$DIRMPASSWD SDPASSWD=$SDPASSWD SDMPASSWD=$SDMPASSWD FDPASSWD=$FDPASSWD FDMPASSWD=$FDMPASSWD EOF fi } # # Function to substitute variables into template # Usage: substitute <template> <output> # # will replace all occurance of XXX_var_XXX to value of environment variable `var' # substitute() { local TEMPLATE DEST HOSTNAME SUBST_VARIABLES SEDCMD TEMPLATE="$1" DEST="$2" HOSTNAME="${HOSTNAME:-`hostname --fqdn 2>/dev/null || hostname`}" SUBST_VARIABLES="${SUBST_VARIABLES:-HOSTNAME DBNAME DBUSER DBPASS \ DIRPASSWD DIRMPASSWD SDPASSWD SDMPASSWD FDPASSWD FDMPASSWD}" SEDCMD="sed" for var in $SUBST_VARIABLES; do value=$(eval echo "\$$var" |sed -e 's/[\/&]/\\&/g') SEDCMD="$SEDCMD -e s/XXX_${var}_XXX/$value/g" done $SEDCMD "$TEMPLATE" >"$DEST" } # # Function to install config file from template # Usage: install_config <package> <config name> [ <template> ] # # use substitute() to generate config # install and register generated file with ucf # install_config() { local PACKAGE CONFIG OLD_VERSION TEMPLATE tempfile PACKAGE="$1" if [ $# -ge 3 ]; then TEMPLATE="$2" CONFIG="$3" else TEMPLATE="/usr/share/bacula-common/defconfig/$(basename '$CONFIG')" CONFIG="$3" fi tempfile=`tempfile` dpkg_conffile_md5sum="$(dpkg-query -W -f='${Conffiles}' \"$PACKAGE\" \ 2>/dev/null |sed -ne "\' $CONFIG ' { s/ obsolete$//; s/.* //; p }")" if [ -n "$dpkg_conffile_md5sum" ]; then echo "$dpkg_conffile_md5sum default" >"$tempfile.md5sum" fi if [ -f "$TEMPLATE.md5sum" ]; then cat "$TEMPLATE.md5sum" >>"$tempfile.md5sum" fi substitute "$TEMPLATE" "$tempfile" ucf --debconf-ok --three-way "$tempfile" "$CONFIG" ucfr "$PACKAGE" "$CONFIG" rm -f "$tempfile" "$tempfile.md5sum" } # # Function to setup /etc/default/* # Usage: call from postinst script "setup_etc_default <package> $@" # # on a fresh install, generate default /etc/default/* file # on an upgrade, preserve ENABLED and CONFIG variables # setup_etc_default() { local PACKAGE SERVICE ENABLED CONFIG DEFAULTS tempfile PACKAGE="$1" if [ "$2" != "configure" ]; then return fi case "$1" in bacula-fd) SERVICE="bacula-fd" ;; bacula-sd) SERVICE="bacula-sd" ;; bacula-director) SERVICE="bacula-dir" ;; *) echo "setup_defaults: unknown package \"$1\"" >&2 return esac ENABLED="yes" CONFIG="/etc/bacula/$SERVICE.conf" DEFAULTS="/etc/default/$SERVICE" if [ -n "$3" ]; then if [ -f "$DEFAULTS" ]; then ENABLED=$(. $DEFAULTS; echo $ENABLED) CONFIG=$(. $DEFAULTS; echo $CONFIG) fi fi tempfile=`tempfile` cat >"$tempfile" <<_EOF # defaults file for $SERVICE # Service can be disabled by setting # ENABLED="no" ENABLED="$ENABLED" # Default config file can be changed here # CONFIG="/etc/bacula/$SERVICE.conf" CONFIG="$CONFIG" _EOF # special case for bacula-sd: timeout for stop action case "$1" in bacula-sd) cat >>"$tempfile" <<_EOF # bacula-sd rewinds tapes before stopping, if this takes long, you can # adjust the timeout before killing it from the init script here #STOPTIMEOUT="180" _EOF ;; esac ucf --debconf-ok "$tempfile" "$DEFAULTS" ucfr "$PACKAGE" "$DEFAULTS" rm -f "$tempfile" }