Dre4m Shell
Server IP : 85.214.239.14  /  Your IP : 3.138.119.162
Web Server : Apache/2.4.62 (Debian)
System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.18
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /proc/2/root/proc/2/cwd/proc/3/root/var/lib/dpkg/info/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /proc/2/root/proc/2/cwd/proc/3/root/var/lib/dpkg/info/dash.postinst
#!/bin/dash
set -e

# $1: dfile, $2: link target, $3: distrib
replace_with_link() {
	dfile="$1"; ltarget=$2; distrib="$DPKG_ROOT$3"
	temp="$dfile.tmp"
	[ -e "$DPKG_ROOT$dfile" ] || [ -L "$DPKG_ROOT$dfile" ] && dfile_exists=yes
	# Safely create a symlink to $ltarget at $dfile, first
	# making a backup of $dfile (the file being diverted)
	# in $distrib (if specified).
	#
	# The cp / ln -s / mv dance avoids having to live without
	# $dfile (think: /bin/sh) for even a moment, so applications
	# running in parallel can continue without trouble.
	if [ -n "$distrib" ] && [ -e "$DPKG_ROOT$dfile" ]; then
		cp -dp "$DPKG_ROOT$dfile" "$distrib"
	fi
	ln -sf "$ltarget" "$DPKG_ROOT$temp"
	mv -f "$DPKG_ROOT$temp" "$DPKG_ROOT$dfile"
	# Since man-db stores symlink modification times in its index.db we
	# need to set a reproducible mtime. We only do that for new symlinks
	# (if dfile doesn't exist yet) to avoid changing to a lower mtime
	# which breaks backup tools.
	targetrealpath="$DPKG_ROOT$(dpkg-realpath "$dfile")"
	if [ -e "$targetrealpath" ] && [ "$dfile_exists" != "yes" ]; then
		touch --no-dereference --reference="$targetrealpath" "$DPKG_ROOT$dfile"
	fi
}

claim_binsh() {
	dfile=$1 ltarget=$2 distrib=${3:-$dfile.distrib}
	diverter=$(dpkg-divert --listpackage $dfile)
	truename=$(dpkg-divert --truename $dfile)

	if [ "$diverter" = dash ]; then
		# good.
		return
	fi

	if [ "$diverter" = LOCAL ]; then
		# The sysadmin wants it this way.  Who am I to argue?
		return
	fi

	if [ -n "$diverter" ] && [ "$diverter" != bash ]; then
		# Let dpkg-divert error out; we are not taking
		# over the diversion, unless we added it
		# ourselves on behalf of bash.
		dpkg-divert --package dash --no-rename --remove $dfile
		echo "This should never be reached"
		exit 1
	fi

	dpkg-divert --package bash --no-rename --remove $dfile
	dpkg-divert --package dash --no-rename --divert $distrib --add $dfile
	# remove the old equivalent of $distrib, if it existed.
	if [ -n "$DPKG_ROOT$truename" ]; then
	       rm -f "$DPKG_ROOT$truename"
	fi
	replace_with_link $dfile $ltarget $distrib
}

unclaim_binsh() {
	dfile=$1 ltarget=$2 distrib=${3:-$dfile.distrib}
	diverter=$(dpkg-divert --listpackage $dfile)
	truename=$(dpkg-divert --truename $dfile)

	if [ "$diverter" != dash ]; then
		# good.
		return
	fi

	# Donate the diversion and sh symlink to the bash package.
	ltarget=$(echo $ltarget | sed s/dash/bash/)
	dpkg-divert --package dash --no-rename --remove $dfile
	dpkg-divert --package bash --no-rename --divert $distrib --add $dfile
	if [ -n "$truename" ]; then
		rm -f "$truename"
	fi
	replace_with_link $dfile $ltarget $distrib
}

initial_binsh_setup() {
	dfile=$1 ltarget=$2 distrib=${3:-$dfile.distrib} ashfile=$4
	diverter=$(dpkg-divert --listpackage $dfile)
	truename=$(dpkg-divert --truename $dfile)

	if [ -z "$diverter" ]; then
		# good.
		return
	fi

	if [ "$diverter" = ash ]; then
		dpkg-divert --package ash --no-rename --remove $dfile
		dpkg-divert --package dash --no-rename --divert $distrib --add $dfile

		if [ "$truename" != "$distrib" ] && [ -e "$truename" ]; then
			mv "$truename" "$distrib"
		fi
		replace_with_link $dfile $ltarget
		return
	fi

	if
		[ -h $dfile ] &&
		[ -f $dfile ] &&
		[ -f $ashfile ] &&
		cmp $dfile $ashfile
	then
		replace_with_link $dfile $ltarget
	fi
}

if [ "$1" = configure ] && [ -z "$2" ]; then
	initial_binsh_setup /bin/sh dash '' /bin/ash
	initial_binsh_setup /usr/share/man/man1/sh.1.gz dash.1.gz \
		/usr/share/man/man1/sh.distrib.1.gz \
		/usr/share/man/man1/ash.1.gz
fi

claim_binsh /bin/sh dash
if [ -d "$DPKG_ROOT/usr/share/man/man1/" ]; then
    claim_binsh /usr/share/man/man1/sh.1.gz dash.1.gz \
        /usr/share/man/man1/sh.distrib.1.gz
fi

# Automatically added by dh_installmenu/13.11.4
if [ "$1" = "configure" ] && [ -x "`command -v update-menus`" ] && [ -x "$DPKG_ROOT`command -v update-menus`" ]; then
	update-menus
fi
# End automatically added section


Anon7 - 2022
AnonSec Team