403Webshell
Server IP : 202.61.199.114  /  Your IP : 216.73.217.139
Web Server : nginx/1.22.1
System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : web20 ( 1018)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/lib/dpkg/info/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/lib/dpkg/info/ntpsec.preinst
#!/bin/sh

set -e

if [ "$1" = "install" ] && [ -z "$2" ]; then
	# If the user is converting from ntp to ntpsec, copy their
	# /etc/default/ntp if and only if it was modified.  This will result
	# in the usual prompt asking the user to resolve their changes.
	if ! [ -e /etc/default/ntpsec ] && [ -e /etc/default/ntp ]; then
		md5sum="$(md5sum /etc/default/ntp | sed -e 's/ .*//')"
		# shellcheck disable=SC2016
		old_md5sum="$(dpkg-query -W -f='${Conffiles}' ntp | \
	                sed -n -e "\' /etc/default/ntp ' { s/ obsolete$//; s/.* //; p }")"
		if [ "$md5sum" != "$old_md5sum" ]; then
			cp /etc/default/ntp /etc/default/ntpsec
		fi
	fi

	# Likewise, copy ntp.conf (if it was modified), changing the drift and log
	# paths in the process.
	if ! [ -e /etc/ntpsec/ntp.conf ] && [ -e /etc/ntp.conf ]; then
		md5sum="$(md5sum /etc/ntp.conf | sed -e 's/ .*//')"
		# shellcheck disable=SC2016
		old_md5sum="$(dpkg-query -W -f='${Conffiles}' ntp | \
	                sed -n -e "\' /etc/ntp.conf ' { s/ obsolete$//; s/.* //; p }")"
		if [ "$md5sum" != "$old_md5sum" ]; then
			mkdir -p /etc/ntpsec
			sed -e "s|/var/lib/ntp/ntp.drift|/var/lib/ntpsec/ntp.drift|" \
			    -e "s|/var/log/ntpstats|/var/log/ntpsec|" \
			    /etc/ntp.conf > /etc/ntpsec/ntp.conf
		fi
	fi
fi

if [ "$1" = "upgrade" ] && [ -n "$2" ]; then
	if dpkg --compare-versions "$2" le-nl "1.1.0+dfsg1-2~"; then
		invoke-rc.d ntp stop || true
	fi
	if dpkg --compare-versions "$2" le-nl "1.1.8+dfsg1-5~" ; then
		rm -f /etc/systemd/system/time-sync.target.wants/ntp-wait.service
	fi
fi

# These are included manually, as the postinst needs custom ordering.
dpkg-maintscript-helper mv_conffile /etc/default/ntp /etc/default/ntpsec 1.1.0\+dfsg1-2\~ ntpsec -- "$@"
dpkg-maintscript-helper mv_conffile /etc/init.d/ntp /etc/init.d/ntpsec 1.1.0\+dfsg1-2\~ ntpsec -- "$@"
dpkg-maintscript-helper mv_conffile /etc/ntp.conf /etc/ntpsec/ntp.conf 1.1.0\+dfsg1-2\~ ntpsec -- "$@"

# Automatically added by dh_installinit/13.11.4
if [ "$1" = "install" ] && [ -n "$2" ] && [ -e "/etc/init.d/ntpsec" ] ; then
	chmod +x "/etc/init.d/ntpsec" >/dev/null || true
fi
# End automatically added section


Youez - 2016 - github.com/yon3zu
LinuXploit