macsat.com OpenWrt and ASUS WL Forum

Oleg's Firmware => Tutorials => Topic started by: dayryad on June 27, 2005, 13:35:54 PM



Title: midnight commander
Post by: dayryad on June 27, 2005, 13:35:54 PM
I have the following script for starting MC:
#!/bin/sh
export TERMINFO="/opt/lib/terminfo"
export TERM="linux"
export LD_LIBRARY_PATH=/opt/lib
/opt/bin/mc

How can i manage to save it , and load it on boot?
MC can be linked to an editor? How?

Best regards,
Dayryad


Title: Re: midnight commander
Post by: macsat on June 27, 2005, 13:42:53 PM

You can put the following in /usr/local/sbin/post-boot :

Code:
#!/bin/sh
export TERMINFO="/opt/lib/terminfo"
export TERM="linux"
export LD_LIBRARY_PATH=/opt/lib

Then you should be able to just type 'mc' when wanting to run Midnight Commander.

I have never tried to link mc to an editor :-)




Title: Re: midnight commander
Post by: dayryad on June 27, 2005, 18:17:25 PM
tried to...
it hang's up: black screen
if you try to write :
#!/bin/sh
export TERMINFO="/opt/lib/terminfo"
export TERM="linux"
export LD_LIBRARY_PATH=/opt/lib
/opt/bin/mc

directly in the command line it works just fine ...
firmware used:WL500g-1.9.2.7-6a
Best regards,
Dayryad


Title: Re: midnight commander
Post by: macsat on June 27, 2005, 19:36:16 PM

Your are right...

On a "normal" linux, you would need to place this :
Code:
export TERMINFO="/opt/lib/terminfo"
export TERM="linux"
export LD_LIBRARY_PATH=/opt/lib

in ~/.bash_profile  where you normally place export statements and so on to be ran at login....but .bash_profile is not beeing used on Olegs firmware.

I will try to hear Oleg about where exports are done in his firmware :-)


Title: Re: midnight commander
Post by: dayryad on June 27, 2005, 19:43:43 PM
tks!

I'll wait for some "good" news!

Best regards,

Dayryad

PS. good job! keep it running!


Title: Re: midnight commander
Post by: david07 on June 27, 2005, 20:56:01 PM
Your "personal" export are done with /opt/etc/profile

(Check the file /etc/profile ;) )


Title: Re: midnight commander
Post by: macsat on June 28, 2005, 07:19:17 AM
Maby it can be done in /opt/etc/profile as you say, but it does work as well placing it in :
/usr/local/root/.profile

(where root is the name of my admin user. Default ASUS name is admin!!)


If you create this file containing :
Code:
export TERMINFO="/opt/lib/terminfo"
export TERM="linux"
export LD_LIBRARY_PATH=/opt/lib

The Midnight Commander will work without problems whenever you log on.

You do need however to create an entry like this :
Code:
/usr/local/root/.profile

In your /usr/local/sbin/.files

and then do a :
Code:
flashfs save
flashfs commit

In order to save the new made .profile script in flash.

Have fun :-)

macsat


Title: Re: midnight commander
Post by: david07 on June 28, 2005, 13:53:19 PM
Maby it can be done in /opt/etc/profile as you say, but it does work as well placing it in :
/usr/local/root/.profile

(where root is the name of my admin user. Default ASUS name is admin!!)


If you create this file containing :
Code:
export TERMINFO="/opt/lib/terminfo"
export TERM="linux"
export LD_LIBRARY_PATH=/opt/lib
It works, tested with
Code:
alias ll="ls -l"
As I am using a lot on my linux machine
The Midnight Commander will work without problems whenever you log on.

You do need however to create an entry like this :
Code:
/usr/local/root/.profile

In your /usr/local/sbin/.files
 
No need to do this because by default all /usr/local files are saved ;)
and then do a :
Code:
flashfs save
flashfs commit

In order to save the new made .profile script in flash.

Have fun :-)

macsat


Title: Re: midnight commander
Post by: hlediks on September 02, 2008, 11:48:35 AM
Your "personal" export are done with /opt/etc/profile

(Check the file /etc/profile ;) )

Yes this works provided you make /opt/etc/profile (or /usr/local/etc/profile) executable. For some strange reason, /etc/profile checks for executability:
[ -x /usr/local/etc/profile ] && . /usr/local/etc/profile
[ -x /opt/etc/profile ] && . /opt/etc/profile

Ciao, ---hlediks