Results 1 to 7 of 7

Thread: Ease-of-use patch to klik's install

  1. #1
    Junior Member
    Join Date
    Jan 2006
    Posts
    4

    Ease-of-use patch to klik's install

    I made a patch to install to make it pop up an xterm, rxvt, konsole or gnome-terminal and su to run klik-cmg-install-root, rather than just popping up a message box telling the user to run it as root. For new users, this should be significantly nicer.

    I don't know if I can properly include it here, but I'll try:

    Code:
    --- install	2005-12-20 13:11:44.000000000 -0500
    +++ install.xterm	2006-01-02 19:17:29.000000000 -0500
    @@ -81,6 +81,20 @@
      esac
     }
     
    +unset XVT
    +# Determine what X virtual terminal to use (if applicable)
    +if [ "$DISPLAY" -a "`tty | grep not`" ]
    +then
    +  for i in xterm rxvt konsole gnome-terminal
    +  do
    +    $i --help
    +    if [ "$?" != "127" ]
    +    then
    +      export XVT="$i -e"
    +    fi
    +  done
    +fi
    +
     cat > $HOME/.klik <<\EOF
     #!/bin/bash
     
    @@ -511,8 +525,25 @@
     fi
     EOF
     chmod 777 "$HOME/klik-cmg-install-root"
    +cat > "$HOME/klik-prompt-root" <<EOF
    +#!/bin/bash
    +echo Please enter your root password:
    +su -c "$HOME/klik-cmg-install-root"
    +EOF
    +chmod 777 "$HOME/klik-prompt-root"
    +
    +# Try su'ing to root
    +$XVT $HOME/klik-prompt-root
    +rm -f "$HOME/klik-prompt-root"
    +
    +# If that didn't work, just tell the user what to do
    +if [ -z "$(cat /etc/fstab | grep app/7)" ]
    +then
    +  dmsgbox "Your /etc/fstab is not setup to use cmg files. Please run $HOME/klik-cmg-install-root as root."
    +else
    +  rm -f "$HOME/klik-cmg-install-root"
    +fi
     
    -(sudo sh "$HOME/klik-cmg-install-root" && rm -f "$HOME/klik-cmg-install-root") || (dmsgbox "Your /etc/fstab is not setup to use cmg files. Please run $HOME/klik-cmg-install-root as root.") 
     fi
     
     #
    [/code]

  2. #2
    Junior Member
    Join Date
    Jan 2006
    Posts
    4
    A new version that detects the terminal by the desktop.

    Code:
    --- install	2005-12-20 13:11:44.000000000 -0500
    +++ install.xterm	2006-01-05 13:30:38.000000000 -0500
    @@ -81,6 +81,31 @@
      esac
     }
     
    +export NATIVEXVT=rxvt
    +if [ "$DIALOG" = "kdialog" ]
    +then
    +  export NATIVEXVT="konsole --nomenubar --notabbar --noframe --noscrollbar"
    +elif [ "$DIALOG" = "zenity" ]
    +then
    +  export NATIVEXVT="gnome-terminal --hide-menubar"
    +fi
    +
    +unset XVT
    +# Determine what X virtual terminal to use (if applicable)
    +if [ "$DISPLAY" -a "`tty | grep not`" ]
    +then
    +  for i in xterm \
    +        rxvt \
    +        "$NATIVEXVT"
    +  do
    +    $i --help
    +    if [ "$?" != "127" ]
    +    then
    +      export XVT="$i -e"
    +    fi
    +  done
    +fi
    +
     cat > $HOME/.klik <<\EOF
     #!/bin/bash
     
    @@ -511,8 +536,25 @@
     fi
     EOF
     chmod 777 "$HOME/klik-cmg-install-root"
    +cat > "$HOME/klik-prompt-root" <<EOF
    +#!/bin/bash
    +echo Please enter your root password:
    +su -c "$HOME/klik-cmg-install-root"
    +EOF
    +chmod 777 "$HOME/klik-prompt-root"
    +
    +# Try su'ing to root
    +$XVT $HOME/klik-prompt-root
    +rm -f "$HOME/klik-prompt-root"
    +
    +# If that didn't work, just tell the user what to do
    +if [ -z "$(cat /etc/fstab | grep app/7)" ]
    +then
    +  dmsgbox "Your /etc/fstab is not setup to use cmg files. Please run $HOME/klik-cmg-install-root as root."
    +else
    +  rm -f "$HOME/klik-cmg-install-root"
    +fi
     
    -(sudo sh "$HOME/klik-cmg-install-root" && rm -f "$HOME/klik-cmg-install-root") || (dmsgbox "Your /etc/fstab is not setup to use cmg files. Please run $HOME/klik-cmg-install-root as root.") 
     fi
     
     #

  3. #3
    Junior Member
    Join Date
    Jan 2006
    Posts
    4
    New version. kdesu and gksu support.

    Code:
    --- install	2005-12-20 13:11:44.000000000 -0500
    +++ install.xterm	2006-01-05 14:10:20.000000000 -0500
    @@ -81,6 +81,59 @@
      esac
     }
     
    +# Determine the native X vt
    +export NATIVEXVT=rxvt
    +if [ "$DIALOG" = "kdialog" ]
    +then
    +  export NATIVEXVT="konsole --nomenubar --notabbar --noframe --noscrollbar"
    +elif [ "$DIALOG" = "zenity" ]
    +then
    +  export NATIVEXVT="gnome-terminal --hide-menubar"
    +fi
    +
    +unset XVT
    +# Determine what X virtual terminal to use (if applicable)
    +if [ "$DISPLAY" -a "`tty | grep not`" ]
    +then
    +  for i in xterm \
    +        rxvt \
    +        "$NATIVEXVT"
    +  do
    +    $i --help
    +    if [ "$?" != "127" ]
    +    then
    +      export XVT="$i -e"
    +    fi
    +  done
    +fi
    +
    +# Determine how to su
    +unset GUISU
    +if [ "$DIALOG" = "kdialog" ]
    +then
    +  kdesu --help
    +  if [ "$?" != "127" ]
    +  then
    +    export GUISU="kdesu -c"
    +  fi
    +elif [ "$DIALOG" = "zenity" ]
    +then
    +  gksu --help
    +  if [ "$?" != "127" ]
    +  then
    +    export GUISU=gksu
    +  fi
    +fi
    +
    +visisu() {
    +  if [ "$GUISU" ]
    +  then
    +    $GUISU $@
    +  else
    +    $XVT /bin/bash -c "echo Please enter your root password:; su -c $@"
    +  fi
    +}
    +
     cat > $HOME/.klik <<\EOF
     #!/bin/bash
     
    @@ -512,7 +565,17 @@
     EOF
     chmod 777 "$HOME/klik-cmg-install-root"
     
    -(sudo sh "$HOME/klik-cmg-install-root" && rm -f "$HOME/klik-cmg-install-root") || (dmsgbox "Your /etc/fstab is not setup to use cmg files. Please run $HOME/klik-cmg-install-root as root.") 
    +# Try su'ing to root
    +visisu $HOME/klik-cmg-install-root
    +
    +# If that didn't work, just tell the user what to do
    +if [ -z "$(cat /etc/fstab | grep app/7)" ]
    +then
    +  dmsgbox "Your /etc/fstab is not setup to use cmg files. Please run $HOME/klik-cmg-install-root as root."
    +else
    +  rm -f "$HOME/klik-cmg-install-root"
    +fi
    +
     fi
     
     #

  4. #4
    Senior Member registered user
    Join Date
    Feb 2003
    Location
    Germany
    Posts
    1,159
    Thanks, I have uploaded it. It can be tested with
    Code:
    wget klik.atekon.de/client/testing/install -O -|sh
    Once it is well tested on all systems, I will make it the default.

    Greetings,
    probono

  5. #5
    Junior Member
    Join Date
    Jan 2006
    Posts
    4
    Speaking of working on all systems ... it didn't work on Ubuntu, apparently it needs to use gksu -a instead of just gksu.

    Code:
    --- install	2006-01-06 00:51:51.000000000 -0800
    +++ install.xterm	2006-01-06 00:52:09.000000000 -0800
    @@ -81,6 +81,59 @@
      esac
     }
     
    +# Determine the native X vt
    +export NATIVEXVT=rxvt
    +if [ "$DIALOG" = "kdialog" ]
    +then
    +  export NATIVEXVT="konsole --nomenubar --notabbar --noframe --noscrollbar"
    +elif [ "$DIALOG" = "zenity" ]
    +then
    +  export NATIVEXVT="gnome-terminal --hide-menubar"
    +fi
    +
    +unset XVT
    +# Determine what X virtual terminal to use (if applicable)
    +if [ "$DISPLAY" -a "`tty | grep not`" ]
    +then
    +  for i in xterm \
    +        rxvt \
    +        "$NATIVEXVT"
    +  do
    +    $i --help
    +    if [ "$?" != "127" ]
    +    then
    +      export XVT="$i -e"
    +    fi
    +  done
    +fi
    +
    +# Determine how to su
    +unset GUISU
    +if [ "$DIALOG" = "kdialog" ]
    +then
    +  kdesu --help
    +  if [ "$?" != "127" ]
    +  then
    +    export GUISU="kdesu -c"
    +  fi
    +elif [ "$DIALOG" = "zenity" ]
    +then
    +  gksu --help
    +  if [ "$?" != "127" ]
    +  then
    +    export GUISU="gksu -a"
    +  fi
    +fi
    +
    +visisu() {
    +  if [ "$GUISU" ]
    +  then
    +    $GUISU $@
    +  else
    +    $XVT /bin/bash -c "echo Please enter your root password:; su -c $@"
    +  fi
    +}
    +
     cat > $HOME/.klik <<\EOF
     #!/bin/bash
     
    @@ -512,7 +565,17 @@
     EOF
     chmod 777 "$HOME/klik-cmg-install-root"
     
    -(sudo sh "$HOME/klik-cmg-install-root" && rm -f "$HOME/klik-cmg-install-root") || (dmsgbox "Your /etc/fstab is not setup to use cmg files. Please run $HOME/klik-cmg-install-root as root.") 
    +# Try su'ing to root
    +visisu $HOME/klik-cmg-install-root
    +
    +# If that didn't work, just tell the user what to do
    +if [ -z "$(cat /etc/fstab | grep app/7)" ]
    +then
    +  dmsgbox "Your /etc/fstab is not setup to use cmg files. Please run $HOME/klik-cmg-install-root as root."
    +else
    +  rm -f "$HOME/klik-cmg-install-root"
    +fi
    +
     fi
     
     #

  6. #6
    Senior Member registered user
    Join Date
    Feb 2003
    Location
    Germany
    Posts
    1,159
    Hi GregorR,

    it doesn't work yet on Knoppix/Kanotix from Live CD (one of klik's main usage areas). Please try it there.
    (You must use "sudo su" there to become root because no root password is set.)

    Greetings,
    probono

  7. #7
    Junior Member
    Join Date
    Jan 2006
    Location
    Oklahoma
    Posts
    1

    THANK YOU!!!

    This patch works great with MEPIS 3.4-3 rc1 it is now easier than ever to use klik!!!

    wget klik.atekon.de/client/testing/install -O -|sh

    You guys rock!!!

Similar Threads

  1. How to install ppscsi-patch
    By mkjtravel in forum Hardware & Booting
    Replies: 0
    Last Post: 11-02-2004, 07:49 AM
  2. How to install supermount kernel patch?
    By eracerbit in forum Hdd Install / Debian / Apt
    Replies: 0
    Last Post: 01-22-2004, 12:48 AM
  3. The easiest kernel install yet and no xfs patch either!
    By rickenbacherus in forum Tips and Tricks
    Replies: 13
    Last Post: 01-20-2004, 03:39 PM
  4. Replies: 3
    Last Post: 08-10-2003, 11:04 AM
  5. Replies: 0
    Last Post: 07-17-2003, 08:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


A-Tech 256GB 4x 64GB 4Rx4 PC4-19200 ECC Load Reduced LRDIMM Server Memory RAM picture

A-Tech 256GB 4x 64GB 4Rx4 PC4-19200 ECC Load Reduced LRDIMM Server Memory RAM

$287.96



Team T-FORCE VULCAN Z 16GB (2 x 8GB) 288-Pin PC RAM DDR4 3200 (PC4 25600) XMP picture

Team T-FORCE VULCAN Z 16GB (2 x 8GB) 288-Pin PC RAM DDR4 3200 (PC4 25600) XMP

$38.99



A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G picture

A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G

$13.99



Samsung 16GB (2x8GB) DDR4 2400MHz PC4-19200 Desktop RAM Memory M378A1K43CB2-CRC picture

Samsung 16GB (2x8GB) DDR4 2400MHz PC4-19200 Desktop RAM Memory M378A1K43CB2-CRC

$19.95



Crucial 16GB (2x 8GB) Kit DDR3L 1600MHz PC3-12800 UDIMM Desktop 240-Pin CL11 RAM picture

Crucial 16GB (2x 8GB) Kit DDR3L 1600MHz PC3-12800 UDIMM Desktop 240-Pin CL11 RAM

$21.33



CORSAIR Vengeance RGB Pro 32GB (2 x 16GB) 288-Pin PC RAM DDR4 3600 (PC4 28800) picture

CORSAIR Vengeance RGB Pro 32GB (2 x 16GB) 288-Pin PC RAM DDR4 3600 (PC4 28800)

$79.95



HyperX FURY RAM DDR4 16GB 8GB 32GB 4GB 3200 2666 2400 2133 Desktop Memory DIMM picture

HyperX FURY RAM DDR4 16GB 8GB 32GB 4GB 3200 2666 2400 2133 Desktop Memory DIMM

$14.85



HyperX FURY DDR3 8GB 16GB 32GB 1600 MHz PC3-12800 Desktop RAM Memory DIMM 240pin picture

HyperX FURY DDR3 8GB 16GB 32GB 1600 MHz PC3-12800 Desktop RAM Memory DIMM 240pin

$12.90



HyperX FURY DDR4 64GB (4x16GB) 3200MHz PC4-25600 Desktop RAM Memory DIMM 288PIN picture

HyperX FURY DDR4 64GB (4x16GB) 3200MHz PC4-25600 Desktop RAM Memory DIMM 288PIN

$129.95



Micron 8GB (2x 4GB) MT8JTF51264AZ-1G6E1 1Rx8 PC3-12800U DDR3 Desktop RAM Memory picture

Micron 8GB (2x 4GB) MT8JTF51264AZ-1G6E1 1Rx8 PC3-12800U DDR3 Desktop RAM Memory

$9.98