Creating a script in Ubuntu to run EMC Networker client

I have been trying to get Networker 7.5.2.1 client installed on a server running Ubuntu 9.0.4. Although Networker don't support this flavour of Linux I have been given some pointers on how to get it set up (inc by EMC support).
The link to what I have to do is here:

http://blog.mc-thias.org/?title=networker-7-5-1-client-on-debian-gnu-linux-5-0-ubuntu-9-04&more=1&c=1&tb=1&pb=1 

I have got stuck at step 6; creating an /etc/init.d/networker script

I have very little Linux experience, hence I don't know how to create a script - I have tried copying the following code into a text editor, renaming it networker.sh and pushing it across to the correct location on the server using WinSCP but it errors with:

Permission denied.
Error code: 3
Error message from server: Permission denied
Request code: 3

I assume this is something to do with sudo, although as I said, being a Linux newbie I could be barking up the wrong tree.

Is there a way I can create the script from within a PuTTY session?

Any pointers would be appreciated

Stu
#! /bin/sh

# Copyright (c) 1990-2009, EMC Corporation

# All rights reserved.

### BEGIN INIT INFO
# Required-Start: syslog network
# Required-Stop: syslog network
# X-UnitedLinux-Should-Start: portmap
# Should-Start: portmap
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: EMC Networker. A backup and restoration software package.
### END INIT INFO

case $1 in
    start)
        (echo 'starting NetWorker daemons:') > /dev/console
        LD_LIBRARY_PATH=/usr/lib/nsr:$LD_LIBRARY_PATH
        export LD_LIBRARY_PATH
        if [ -f /usr/sbin/nsrexecd ]; then
                if [ -f /usr/sbin/NetWorker.clustersvr ]; then
                        if [ -f /nsr.NetWorker.local -o -h /nsr.NetWorker.local ]; then
                                if [ -h /nsr ]; then
                                        rm -f /nsr
                                        ln -s /nsr.NetWorker.local /nsr
                                fi
                        fi
                fi
            (/usr/sbin/nsrexecd) > /dev/console 2>&1
            (echo ' nsrexecd') > /dev/console
        fi
        if [ -f /usr/sbin/lgtolmd ]; then
            (/usr/sbin/lgtolmd -p /nsr/lic -n 1) > /dev/console 2>&1
            (echo ' lgtolmd') > /dev/console
        fi
        if [ -f /usr/sbin/nsrd -a \
             ! -f /usr/sbin/NetWorker.clustersvr ]; then
            (/usr/sbin/nsrd) > /dev/console 2>&1
            (echo ' nsrd') > /dev/console
        fi
        ;;
    stop) 
        (echo 'stopping NetWorker daemons:') > /dev/console
        if [ -f /usr/sbin/nsr_shutdown ]; then
            if [ -f /usr/sbin/NetWorker.clustersvr ]; then
                (/usr/sbin/nsr_shutdown -q) > /dev/console 2>&1
                (echo ' nsr_shutdown -q') > /dev/console
            else
                (/usr/sbin/nsr_shutdown -q) > /dev/console 2>&1
                (echo ' nsr_shutdown -q') > /dev/console
            fi
        fi
        ;;
    status)
        if [ -f /usr/sbin/nsr_shutdown ]; then
            /usr/sbin/nsr_shutdown -l
        fi
        ;;
    *)
        echo "usage: `basename $0` {start|stop|status}"
        ;;
esac

Open in new window

HelpDeskECAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TobiasHolmCommented:
Hi!

You'd have to set the x-bit on the script to be able to execute it.

You can set the file rights with 'chmod'. If you use chmod 777 everyone gets access to the file and can execute it.

Here's a page about file security in Linux: http://www.andrewolong.com/index.html#uid

Yes, you can do it from within a PuTTY session.

Regards, Tobias
0
cjl7freelance for hireCommented:
Hi,

Just ssh into the box and then become root (sudo su -)

I don't know if you have used 'vi' before so I'll do it another way...

run this command

cat > /var/tmp/networker

Paste your file (as printed above)
hit ENTER
hit CNTR d

Now you have created a file called 'networker' in /var/tmp. You can try to use it by doing

sh /var/tmp/networker start
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.