need some help with bash script


sacretagent

Recommended Posts

Hi

 

trying to upgrade the Hamachi plugin for unraid6

and basically i don't need to insert the old tun.ko any more

just a basic modprobe -v tun does the trick in unraid 6

 

so i changed the doinst.sh script from this (unraid 5 version)

 

#!/bin/sh
if [[ -z `modprobe -l tun` ]]; then
    if [[ `uname -r` == *2.6.32.9* ]]; then
        insmod /tmp/2.6.32.9-tun.ko
    else
        echo -e "\nWrong kernel version. Aborting...\n"
        exit
    fi
else
    resp=`modprobe -v tun 2>&1`
    if [[ $? == 0 ]]; then
        echo -e "\nModule inserted sucessfully.\n"
    else
        echo -e "\nModule insertion failed. Aborting...\n"
        exit
    fi
fi

ln -sf /usr/local/logmein-hamachi/hamachid /usr/bin/hamachi
ln -sf /etc/rc.d/rc.hamachi /usr/bin/h2control
h2control start
echo -e "\nHamachi initiated."

 

to

 

#!/bin/sh
modprobe -v tun
ln -sf /usr/local/logmein-hamachi/hamachid /usr/bin/hamachi
ln -sf /etc/rc.d/rc.hamachi /usr/bin/h2control
h2control start
echo -e "\nHamachi initiated."

 

now when the modprobe -v tun is executed i get this error

 

Verifying package hamachi-2.1.0.119-X64-unRAID.txz.

Installing package hamachi-2.1.0.119-X64-unRAID.txz:

PACKAGE DESCRIPTION:

# LogMeIn Hamachi2 v.2.0.1.15 for unRAID

#

# LogMeIn Hamachi2  is a hosted  VPN service that  securely connects

# devices and networks, extending  LAN-like network  connectivity to

# mobile users, distributed teams and business applications. You can

# easily create secure virtual networks on demand, across public and

# private networks.

#

# Package compiled by [email protected]

#

WARNING:  Package has not been created with 'makepkg'

Executing install script for hamachi-2.1.0.119-X64-unRAID.txz.

not found.ATAL: Module tun

install/doinst.sh: line 5: h2control: command not found

 

Hamachi initiated.

Package hamachi-2.1.0.119-X64-unRAID.txz installed.

 

root@P8H67:~# h2control

-bash: h2control: command not found

 

so it barfs because somehow it has no way to output the outcome from the modprobe line

 

it installs the tun though because when i manually input the 2 ln lines then he starts

root@P8H67:~# ln -sf /usr/local/logmein-hamachi/hamachid /usr/bin/hamachi

root@P8H67:~# ln -sf /etc/rc.d/rc.hamachi /usr/bin/h2control

root@P8H67:~# h2control start

root@P8H67:~# top

 

SO what am  doing wrong here ?

can somebody provide the solution?

Link to comment
  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.