Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 13.59.22.153
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : www-data ( )
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/lib/dpkg/info/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/lib/dpkg/info/keyboard-configuration.postinst
#!/bin/sh

set -e

# Source debconf library.
. /usr/share/debconf/confmodule

# The same as /usr/bin/which - in order to make "which" available before
# /usr is mounted
which () {
    local IFS
    IFS=:
    for i in $PATH; do
	if [ -x "$i/$1" ]; then
	    echo "$i/$1"
	    return 0
	fi
    done
    return 1
}

# In d-i the config script is not executed automatically
if [ -f /usr/share/console-setup/keyboard-configuration.config ]; then
    /usr/share/console-setup/keyboard-configuration.config || exit $?
fi



keyboard_present () {
    local kern kbdpattern class subclass protocol

    kern=`uname -r`
    case "$kern" in
	1*|2.0*|2.1*|2.2*|2.3*|2.4*|2.5*)
	    # can't check keyboard presence
	    return 0; 
	    ;;
    esac

    [ -f /proc/bus/input/devices ] || return 0
    kbdpattern="AT Set \|AT Translated Set\|AT Raw Set"
    kbdpattern="$kbdpattern\|Atari Keyboard"
    kbdpattern="$kbdpattern\|Amiga Keyboard"
    kbdpattern="$kbdpattern\|HIL keyboard"
    kbdpattern="$kbdpattern\|ADB keyboard"
    kbdpattern="$kbdpattern\|Sun Type"
    if grep -i "$kbdpattern" /proc/bus/input/devices >/dev/null; then
	return 0
    fi

    [ -d /sys/bus/usb/devices ] || return 0
    for d in /sys/bus/usb/devices/*:*; do
	[ -d "$d" ] || continue
	class=$(cat "$d/bInterfaceClass") # 03 = Human Interface Device
	subclass=$(cat "$d/bInterfaceSubClass") # 01 = Boot Interface Subclass
	protocol=$(cat "$d/bInterfaceProtocol") # 01 = Keyboard
	case "$class:$subclass:$protocol" in
	    03:01:01)
		return 0
		;;
	esac
    done

    return 1
}

# keyboard_present () {
#     if there is a keyboard; then
# 	return 0
#     else
# 	return 1
#     fi
# }

CONFIGFILE=/etc/default/keyboard

if [ "$1" = "configure" -a ! -L "$CONFIGFILE" ]; then
    
    db_get keyboard-configuration/modelcode
    model="$RET"

    db_get keyboard-configuration/layoutcode
    layout="$RET"

    db_get keyboard-configuration/variantcode
    variant="$RET"

    db_get keyboard-configuration/optionscode
    options="$RET"

    if [ ! -e $CONFIGFILE ]; then
	cat /usr/share/console-setup/keyboard \
	    2>/dev/null >$CONFIGFILE || true
    fi

    # Ensure we do not mess up the config file's ownership and permissions.
    cp -a -f $CONFIGFILE $CONFIGFILE.tmp

    # If the admin deleted or commented some variables but then set
    # them via debconf, (re-)add them to the conffile.
    for var in XKBMODEL XKBLAYOUT XKBVARIANT XKBOPTIONS BACKSPACE; do
        if ! grep "^ *${var}=" $CONFIGFILE >/dev/null; then
	    echo "${var}=" >>$CONFIGFILE
	fi
    done    
    
    sed \
	-e "s|^ *XKBMODEL=.*|XKBMODEL=\"$model\"|" \
	-e "s|^ *XKBLAYOUT=.*|XKBLAYOUT=\"$layout\"|" \
	-e "s|^ *XKBVARIANT=.*|XKBVARIANT=\"$variant\"|" \
	-e "s|^ *XKBOPTIONS=.*|XKBOPTIONS=\"$options\"|" \
	-e "s|^ *BACKSPACE=.*|BACKSPACE=\"${BACKSPACE:-guess}\"|" \
	<$CONFIGFILE >$CONFIGFILE.tmp
    
    mv -f $CONFIGFILE.tmp $CONFIGFILE

    db_set keyboard-configuration/store_defaults_in_debconf_db true
fi

if type plymouth >/dev/null && plymouth --ping; then
    # setting the keymap breaks with plymouth in raw mode, and setting the
    # font will currently also break if on vgacon
    if type setupcon >/dev/null 2>&1; then
	setupcon --save-only
    fi
elif keyboard_present; then
    if [ "$DISPLAY" ] && which setxkbmap >/dev/null; then
	setxkbmap -option '' -model "$model" "$layout" "$variant" "$options" || true
	# setting the font corrupts X
	if type setupcon >/dev/null 2>&1; then
	    setupcon --save-only
	    setupcon --force -k
	    cat >&2 <<EOF
Your console font configuration will be updated the next time your system
boots. If you want to update it now, run 'setupcon' from a virtual console.
EOF
	fi
    else
	case "`uname`" in
	    *GNU*)
		[ ! -f /var/run/hurd-console.pid ] || kill `cat /var/run/hurd-console.pid`
		;;
	    *)
		if type setupcon >/dev/null 2>&1; then
		    setupcon --force --save
		fi
		;;
	esac
    fi
fi

# Automatically added by dh_installinit
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
	if [ -x "/etc/init.d/keyboard-setup" ]; then
		update-rc.d keyboard-setup start 49 S . >/dev/null || exit $?
	fi
fi
# End automatically added section
# Automatically added by dh_installinit
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
	if [ -x "/etc/init.d/console-setup" ]; then
		update-rc.d console-setup start 49 S . >/dev/null || exit $?
	fi
fi
# End automatically added section
# Automatically added by dh_installudev
if [ "$1" = configure ]; then
	if [ -e "/etc/udev/rules.d/85_keyboard-configuration.rules" ]; then
		echo "Preserving user changes to /etc/udev/rules.d/85-keyboard-configuration.rules ..."
		if [ -e "/etc/udev/rules.d/85-keyboard-configuration.rules" ]; then
			mv -f "/etc/udev/rules.d/85-keyboard-configuration.rules" "/etc/udev/rules.d/85-keyboard-configuration.rules.dpkg-new"
		fi
		mv -f "/etc/udev/rules.d/85_keyboard-configuration.rules" "/etc/udev/rules.d/85-keyboard-configuration.rules"
	fi
fi
# End automatically added section


if type update-initramfs >/dev/null 2>&1; then
    update-initramfs -u
fi

exit 0

Anon7 - 2022
AnonSec Team