LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 10-29-2004, 01:42 AM   #1
vinoth.ilango
LQ Newbie
 
Registered: Oct 2004
Posts: 4

Rep: Reputation: 0
Unhappy Scripting super user premission


Can anyone help me on the following problem,

operating system = SunOS 5.9.

I have a bash redundancy script file.

Among other functionalities, the redundancy script has to do 'ifconfig', therefore I have to run the script in superuser previlage. which is very annoying.

Is there anyway I can run the script in normal user previlage and at the sametime achieve 'ifconfig' ?

Sample script
=============

#!/bin/bash

PAUSE=2
MISSED=0
MAX_MISSES=3
interface=bge0
subif=:1
netmask=255.255.0.0
broadcast=172.16.255.255
servicename=172.16.0.48


/sbin/ifconfig ${interface}${subif} plumb
/sbin/ifconfig ${interface}${subif} inet ${servicename} netmask ${netmask} broadcast ${broadcast} down

# start the processes over here

while true;do
if ! ping 172.16.0.48 1 &> /dev/null ; then
MISSED=`expr $MISSED + 1`
echo "MISSED: $MISSED"
fi

if [ $MISSED -eq $MAX_MISSES ]; then
echo "Need to do a switch over"
/sbin/ifconfig ${interface}${subif} up
grarp ${interface} ${servicename}

# 1. Stop the processes over here

sleep $PAUSE

# restart the processes over here.

MISSED=0
fi
sleep $PAUSE
done



Thanks and Regards,

Vinoth

Vinoth.ilango@gmail.com
 
Old 10-29-2004, 03:22 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
I just answered yesterday a very close question, see http://www.linuxquestions.org/questi...24#post1260924
for a solution, replace 1000 by 0 to grant root access.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Running super user commands as normal user mickyg Linux - Security 5 10-14-2005 07:25 PM
How can i acess like super user...? Khmer Slackware 13 08-13-2005 09:39 AM
super user, mandrake 9.2 FF103 Mandriva 5 05-28-2004 10:38 AM
Super User boyinfrance Linux - Newbie 1 06-17-2002 12:07 PM
normal user = super user jayakrishnan Linux - General 4 03-19-2002 09:58 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 03:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration