Current File : //sbin/paperconfig
#! /bin/sh

# paperconfig: configuration of system paper name
#
# Copyright (C) 1996, Yves Arrouye <[email protected]>
#               2001, Adrian Bunk  <[email protected]>

usage() {
    if [ "$1" = -h ]
    then
	exec 1>&2
	echo -n U
    else
	echo -n u
    fi

    echo "sage: `basename $0` [ -v, --version ] [ -h, --help ] [ -p, --paper name | --force ]"

    if [ "$1" = -h ]
    then
	cat <<EOF

Options: -v, --verbose          print version information and exit
         -h, --help             print this help and exit
	 -p, --paper name	specify the paper to use
         --force                force paper configuration
EOF
	exit 0
    else
	exit 1
    fi
}

# "|| true" added below, to assure that the script does not fail even if
# called with bash -e. (MP 22/08/98)

unset PAPERSIZE || true 
: ${PAPERCONF:=/etc/papersize}
export PAPERCONF

unset PAPERDIR || true 
: ${PAPERDIR:=/etc/libpaper.d}
export PAPERDIR

force=0

if [ "$#" -eq 0 ]
  then
    usage
fi

while [ $# -ne 0 ]
do
    case "$1" in
	-v|--version)
	    echo "`basename $0` version 1.0" \
		"by Yves Arrouye <[email protected]>"
	    exit 0
	    ;;
	-h|--help)
	    usage -h
	    ;;
	-p|--paper)
	    test $# -gt 1 || usage
	    paper="$2"
	    shift
	    ;;
	--force)
	    force=1
	    ;;
	*)
	    usage
	    ;;
    esac
    shift
done

invalidpaper() {
    ! paperconf "$1" 2>/dev/null 1>&2
}

format() {
    _maxwidth=$1; shift
    _start="$1"; shift

    _cline=

    for w
    do
	if [ `echo "$_start$_cline$w " | wc -c` -ge 0$_maxwidth ]
	then
	    echo "$_cline"
	    _cline=
	    _start=
	fi
	_cline="$_cline$w "
    done

    if [ -n "$_cline" ]
    then
	echo "$_cline"
    fi

    unset _maxwidth _cline _start
}

# "chmod 644" added below, to assure that the conf file is created
# with the right access permissions (MP 13/05/2000)

setpaper() {
    paperright=`paperconf "$1" 2>/dev/null`

    ok=0

    if 2>/dev/null echo "$paperright" >${PAPERCONF}.new
    then
        if 2>/dev/null mv -f ${PAPERCONF}.new $PAPERCONF
	then
	    if 2>/dev/null chmod 644 $PAPERCONF
	    then
		ok=1
            fi
        fi
    fi

    if [ $ok -eq 0 ]
    then
        echo `basename $0`: cannot create $PAPERCONF
        exit 2
    else
	#
	# Added code for calling back applications when
	# papersize changes. See bug #345466
	# [email protected], 2006-01-05
	if [ -d ${PAPERDIR} ]
	then
	    run-parts ${PAPERDIR}
	fi
    fi
}

if [ ! -z "$paper" ]
then
    if invalidpaper $paper
    then
	>&2 echo `basename $0`: \"$paper\" is not a known paper name
	exit 3
    fi
    setpaper "$paper"
    exit 0
fi

knownpapers="`paperconf -a`"

prompt=
width=72

# "|| true" added below, to assure that the script does not fail even if 
# called with bash -e. (MP 22/08/98)

paper=`paperconf 2>/dev/null || true`
dftpaper=`paperconf -d`

if [ $force -eq 1 ] || [ ! -e $PAPERCONF ] || invalidpaper $paper
then
    papers="`format $width \"\" $knownpapers`"
    echo

    if [ -x /usr/bin/pager ]
    then
	: ${PAGER:=/usr/bin/pager}
    fi
    if [ -x /bin/more ]
    then
	: ${PAGER:=/bin/more}
    fi
    : ${PAGER:=cat}

    LESS="-X -E $LESS"
    export LESS

    (
	cat <<EOF
The default (also known as system) paper can be chosen from many known
papers that are currently recognized by programs using the libpaper
library (with libpaper, paper names are case insensitive; if you use
programs that use the system paper size but do not rely on the libpaper
library, this may not be true and some of the papers listed below may
not be known by these programs):

EOF
	echo "$papers" | sed 's/^/    /'
	echo
    ) | ${PAGER}

    : ${paper:=$dftpaper}

    echo -n "Default paper name? [$paper] "
    read ans
    : ${ans:=$paper}
    paper=$ans
fi

while invalidpaper "$paper"
do
    if [ -z "$paper" ]
    then
	echo "Please choose a paper from the available papers list."
    else
	echo "Unknow paper \"$paper\"," \
	    "please choose one from the available papers list."
    fi

    paper=$dftpaper

    echo -n "Default paper name? [$paper] "
    read ans
    paper=$ans
done

if [ "`paperconf 2>/dev/null`" != "$paper" ] || grep -q "[# 	]" $PAPERCONF
then
    setpaper "$paper"
fi

exit 0

blog

blog

Meilleur Casino en ligne 2025 – Classement complet.6745

Содержимое Les meilleurs casinos en ligne pour jouer en 2025 Les casinos en ligne français légaux Les nouveaux casinos en ligne Comment choisir le meilleur casino en ligne pour vous Meilleur Casino en ligne 2025 – Classement complet Les casinos en ligne sont devenus très populaires ces dernières années, offrant …

Read More »

Neue Online Casinos in Deutschland.346

Neue Online Casinos in Deutschland ▶️ SPIELEN Содержимое Die Top 5 Neuen Online Casinos in Deutschland Wie funktionieren Online Casinos in Deutschland? Das Online Casino Testbericht Die Vorteile von Online Casinos in Deutschland Mobile Online Casinos in Deutschland Die Online-Casinos-Szene in Deutschland ist ständig in Bewegung. Neue Anbieter kommen auf …

Read More »

Erfahrungen mit Online Casinos in Deutschland.21

Erfahrungen mit Online Casinos in Deutschland ▶️ SPIELEN Содержимое Die Vorteile von Online-Casinos Flexibilität Wahlmöglichkeiten Sicherheit Die Bedenken und Risiken Die Risiken von Online-Casinos Wie wählt man das richtige Online-Casino aus? Top Online Casinos in Deutschland Online Casinos in Deutschland – Ein Überblick Die wichtigsten Regeln und Vorschriften für Online …

Read More »

Meilleur Casino en ligne 2025 – Classement complet.4306

Содержимое Les meilleurs casinos en ligne pour jouer en 2025 Comment choisir le meilleur casino en ligne pour vous Les critères pour choisir le meilleur casino en ligne Meilleur Casino en ligne 2025 – Classement complet Les casinos en ligne sont devenus très populaires ces dernières années, offrant une expérience …

Read More »

Meilleur Casino en Ligne 2025 – Top 10 des Casinos Fiables.4313

Содержимое Les Critères de Sélection Les Meilleurs Casinos en Ligne 2025 Les Critères de Sélection Les Meilleurs Casinos en Ligne 2025 Meilleur Casino en Ligne 2025 – Top 10 des Casinos Fiables Les casinos en ligne sont devenus très populaires ces dernières années, offrant une expérience de jeu en ligne …

Read More »

Chicken Road slot w kasynie online jak grać.791

Содержимое Wprowadzenie do gry Chicken Road Slot Zasady gry i bonusy w grze Chicken Road Chicken Road slot w kasynie online – jak grać Wśród wielu slotów, które możemy znaleźć w kasynach online, jeden z nich wyróżnia się swoją oryginalnością i fascynującą atmosferą – chicken road . To nie tylko …

Read More »

Chicken Road slot w kasynie online dostępność mobilna.875

Содержимое Wprowadzenie do gry Chicken Road Slot Wymagania gry Jak grać w Chicken Road Slot? Zasady gry i bonusy w grze Chicken Road Wyniki testu: jak gra się w mobilnym wersji Chicken Road Slot Chicken Road slot w kasynie online – dostępność mobilna Wśród wielu slotów dostępnych w kasynach online, …

Read More »

Meilleur Casino en Ligne 2025 – Top 10 des Casinos Fiables.2758

Содержимое Les Meilleurs Casinos en Ligne pour les Joueurs Français Meilleur Casino en Ligne 2025 – Top 10 des Casinos Fiables Les casinos en ligne sont devenus très populaires ces dernières années, offrant une expérience de jeu en ligne sécurisée et amusante. Mais comment choisir le meilleur casino en ligne …

Read More »