Shell In A Box

Questions that don't fit in any category below may go here
Forum rules
Please note the disclaimer before modifying your Synology Product.

Shell In A Box

Postby bubblesnout » Sat Oct 01, 2011 2:56 am

http://code.google.com/p/shellinabox/

Has anybody tried to install this? I'm sure it's pretty straightforward, just not sure where to start. Could even be easy to package into a spk, not sure.

Any thoughts would be great!
bubblesnout
Trainee
Trainee
 
Posts: 18
Joined: Tue Aug 16, 2011 4:28 am

Re: Shell In A Box

Postby bubblesnout » Sat Oct 01, 2011 8:52 am

For anyone interested, I got this going.

Firstly install ipkg, then do the following:

Code: Select all
ipkg install gawk
ipkg install gcc
ipkg install make

Then extract the tar.gz package to anywhere. I threw it in /tmp/. I did it through Windows, but you could do it something like this (untested)

Code: Select all
cd /tmp
wget http://code.google.com/p/shellinabox/downloads/detail?name=shellinabox-2.10.tar.gz
tar xvfz shellinabox-2.10.tar.gz

Then go to the directory you extracted it to

Code: Select all
cd /tmp/shellinabox-2.10

Run the following commands to install it

Code: Select all
./configure
make
make install

All set up! To run it, type in

Code: Select all
shellinaboxd -b

You can create a startup script to run the above command so you don't have to manually run it whenever you restart your Synology device.
To do that, create a file in /usr/syno/etc/rc.d/ named S99zzsiab.sh containing something like this (untested)

Code: Select all
#!/bin/sh
if [ "start" = "\$1" ]; then
  shellinaboxd -b
elif [ "stop" = "\$1" ]; then
  killall shellinaboxd
elif [ "restart" = "\$1" ]; then
  \$0 stop
  \$0 start
elif [ "" = "\$1" ]; then
  echo "use start, stop or restart as arguments."
fi

Then make sure it's executable

Code: Select all
chmod +x S99zzsiab.sh


Once it's all ready to go, you can browse to http://DiskstationIPAddress:4200/ to access it.
bubblesnout
Trainee
Trainee
 
Posts: 18
Joined: Tue Aug 16, 2011 4:28 am

Re: Shell In A Box

Postby CoolRaoul » Thu Apr 19, 2012 8:17 pm

bubblesnout wrote:For anyone interested, I got this going.
Code: Select all
#!/bin/sh
if [ "start" = "\$1" ]; then
  shellinaboxd -b
elif [ "stop" = "\$1" ]; then
  killall shellinaboxd
elif [ "restart" = "\$1" ]; then
  \$0 stop
  \$0 start
elif [ "" = "\$1" ]; then
  echo "use start, stop or restart as arguments."
fi



Could someone explain the purpose of the backslashes (as in "\$1") in that script?
CR
CoolRaoul
Sharp
Sharp
 
Posts: 162
Joined: Tue May 18, 2010 7:08 pm

Re: Shell In A Box

Postby maxxfi » Fri Apr 20, 2012 6:39 am

CoolRaoul wrote:Could someone explain the purpose of the backslashes (as in "\$1") in that script?


Hmm... Actually I think they are not needed, the script has to read the first parameter ($1), not compare string 'start' with string '$1'.

With backslash:
[root@Synology /tmp]# cat shellin.sh
#!/bin/sh

if [ "start" = "\$1" ]; then
echo "got start"
else
echo "got nothing"
fi
[root@Synology /tmp]# ./shellin.sh start
got nothing

while without backslash:
[root@Synology /tmp]# cat shellin.sh
#!/bin/sh

if [ "start" = "$1" ]; then
echo "got start"
else
echo "got nothing"
fi
[root@Synology /tmp]# ./shellin.sh start
got start
DS-411 (DSM 4.2-3202) w/ 2x WD10EFRX + 1x HD154UI
DS-106j (DSM 3.0-1357), PATA-to-SATA adapter, 2.5" HM250HI
User avatar
maxxfi
Architect
Architect
 
Posts: 4324
Joined: Sun Dec 27, 2009 12:13 pm
Location: Espoo, Finland


Return to General Mods

Who is online

Users browsing this forum: No registered users and 4 guests