File: gkdebconf-term

package info (click to toggle)
gkdebconf 2.1.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,088 kB
  • sloc: ansic: 1,296; sh: 612; xml: 598; makefile: 57; sed: 16
file content (48 lines) | stat: -rwxr-xr-x 1,010 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash

export TEXTDOMAIN=gkdebconf-term

DONTUSEMSG=`gettext "\
This program is not to be used alone, it is a wrapper for dpkg-reconfigure\n\
used by gkdebconf, use it instead."`

NEEDROOTMSG=`gettext "To run dpkg-reconfigure I need root, please type your password:"`

SUCMSG=`gettext "dpkg-reconfigure has successfully finished..."`

ERRMSG=`gettext "dpkg-reconfigure has failed..."`

KEYMSG=`gettext "press enter to continue..."`

if [ -z "$1" ] || [ -z "$2" ]; then
    echo -e $DONTUSEMSG
    exit 1;
fi 

if xhost | grep -q 'LOCAL:'; then
    XHOST_HAD_LOCAL=1
else
    xhost +local: > /dev/null 2>&1
    XHOST_HAD_LOCAL=0
fi

if [ "$UID" '!=' "0" ]; then
    echo -e $NEEDROOTMSG
    /bin/su -c "/usr/sbin/dpkg-reconfigure -f\"$1\" \"$2\""
else
    /usr/sbin/dpkg-reconfigure -f"$1" "$2"
fi

if [ "$XHOST_HAD_LOCAL" = "0" ]; then
    xhost -local: > /dev/null 2>&1
fi

if [ "$?" != "0" ]; then
    echo -e $ERRMSG
    echo $KEYMSG
    read N
else
    echo -e $SUCMSG
    echo $KEYMSG
    read N
fi