| Server IP : 103.88.176.108 / Your IP : 216.73.216.222 Web Server : Apache/2.4.41 (Ubuntu) System : Linux webserver 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.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 : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/lib/dpkg/info/ |
Upload File : |
#!/bin/bash
# postinst script for nbd-client
#
# see: dh_installdeb(1)
set -e
. /usr/share/debconf/confmodule
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see /usr/share/doc/packaging-manual/
#
# quoting from the policy:
# Any necessary prompting should almost always be confined to the
# post-installation script, and should be protected with a conditional
# so that unnecessary prompting doesn't happen if a package's
# installation fails and the `postinst' is called with `abort-upgrade',
# `abort-remove' or `abort-deconfigure'.
translate_extra() {
sep="\t"
while [ ! -z "$1" ]
do
case "$1" in
-b*)
opt=$2
NBD_OPT="${NBD_OPT}${sep}bs=${opt}"
shift
;;
-t*)
opt=$2
NBD_OPT="${NBD_OPT}${sep}timeout=${opt}"
shift
;;
-sdp|-S)
NBD_OPT="${NBD_OPT}${sep}sdp"
;;
-p*)
NBD_OPT="${NBD_OPT}${sep}persist"
;;
-unix|-u)
NBD_OPT="${NBD_OPT}${sep}unix"
;;
-swap|-s)
NBD_OPT="${NBD_OPT}${sep}swap"
;;
esac
shift
sep=","
done
}
convert_from_sh() {
if [ ! -e /etc/nbd-client ]
then
# nothing to convert from
return
fi
local old_md5sum=$(dpkg-query -W -f='${Conffiles}' nbd-client | awk '/nbdtab/{print $2}')
local new_md5sum=$(md5sum /etc/nbdtab)
if [ "$old_md5sum" != "$new_md5sum" ]
then
# nbdtab locally modified
return
fi
TMPFILE=$(mktemp /tmp/nbd-client.XXXXXX)
. /etc/nbd-client
# check if we may auto-generate
if [ "$AUTO_GEN" == "n" ]
then
db_get nbd-client/no-auto-config
db_go
db_stop
return
fi
# check for KILLALL, which isn't supported anymore
if [ "$KILLALL" != "false" ]
then
db_get nbd-client/killal_set
db_go
db_stop
return
fi
i=0
while [ ! -z "${NBD_TYPE[$i]}" ]
do
NBD_DEVICE[$i]=${NBD_DEVICE[$i]#/dev/}
NBD_OPT=""
translate_extra ${NBD_EXTRA[$i]}
echo -e "${NBD_DEVICE[$i]}\t${NBD_HOST[$i]}\t${NBD_NAME[$i]}${NBD_OPT}" >> $TMPFILE
i=$(( $i + 1 ))
done
mv $TMPFILE /etc/nbdtab
chmod 644 /etc/nbdtab
mv /etc/nbd-client /etc/nbd-client.old
}
case "$1" in
configure)
convert_from_sh
# Invoke initramfs trigger
if [ -f /$(which update-initramfs) ]
then
update-initramfs -u
fi
# Migrate sendsigs.omit.d file
if [ -f /lib/init/rw/sendsigs.omit.d/nbd-client ]
then
mv /lib/init/rw/sendsigs.omit.d/nbd-client /run/sendsigs.omit.d
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
# We need not do anything.
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 0
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
# Automatically added by dh_installinit/12.7ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -x "/etc/init.d/nbd-client" ]; then
update-rc.d nbd-client start 41 S . stop 34 0 6 . >/dev/null || exit 1
fi
fi
# End automatically added section
exit 0