4a - Using Sudo at a "Big" company, March/2003 - Alek`s Free Personal Web Pages     [<Prev][TOC][Next>] <=== Navigation Buttons

Sudo wrapper script to support heterogeneous environment

 /#!/bin/sh
 OS=`uname -s | sed -e 's/-//'`
 OSREL=`uname -r | sed -e 's/^[A-Z]*//' -e 's/^\.//' -e 's/\..*$//'`
 if [ "$OS" = "IRIX64" ]; then OS=IRIX; fi
 if [ "$OS" = "AIX" ]; then
     OSREL=`uname -v`
     OSMIN=`uname -r`
 fi
 OSTYPE=$OS$OSREL
 DIR=/appl/sudo
 CMD=`basename $0`
 RUNCMD=$DIR/$OSTYPE/bin/$CMD
 PATH=$DIR/$OSTYPE/bin:${PATH}; export PATH
 if [ -x $RUNCMD ]; then
     exec $CMD ${1+"$@"}
 else
     echo "could not find $RUNCMD"
 fi