#!/bin/bash

if [ x"$KDE_FULL_SESSION" = x"true" ]; then
{ #KDE
    if [ -f /usr/bin/kdesudo ]; then ROOT="/usr/bin/kdesudo"; else
      if [ -f /usr/bin/kdesu ]; then ROOT="/usr/bin/kdesu"; else
        if [ -f /usr/bin/gksu ]; then ROOT="/usr/bin/gksu"; else
          ROOT='sudo'
        fi
      fi
    fi
} #KDE (End)
else if [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then
{ #Gnome
    if [ -f /usr/bin/gksu ]; then ROOT="/usr/bin/gksu"; else
      if [ -f /usr/bin/kdesudo ]; then ROOT="/usr/bin/kdesudo"; else
        if [ -f /usr/bin/kdesu ]; then ROOT="/usr/bin/kdesu"; else
          ROOT='sudo'
        fi
      fi
    fi
} #Gnome (End)
else if [ x"$DISPLAY" != x"" ]; then
{ #Other X
    if [ -f /usr/bin/gksu ]; then ROOT="/usr/bin/gksu"; else
      if [ -f /usr/bin/kdesudo ]; then ROOT="/usr/bin/kdesudo"; else
        if [ -f /usr/bin/kdesu ]; then ROOT="/usr/bin/kdesu"; else
          ROOT='sudo'
        fi
      fi
    fi
} #Other X (End)
else
{ #No known session
    if [ -f /usr/bin/gksu ]; then ROOT="/usr/bin/gksu"; else
      if [ -f /usr/bin/kdesudo ]; then ROOT="/usr/bin/kdesudo"; else
        if [ -f /usr/bin/kdesu ]; then ROOT="/usr/bin/kdesu"; else
          ROOT='sudo'
        fi
      fi
    fi
} #No known session (End)
fi
fi
fi
$ROOT ./install-self-inex
/usr/bin/i-nex
exit 0