macsat.com OpenWrt and ASUS WL Forum
November 21, 2008, 08:53:38 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?
Login with username, password and session length
News: Back to macsat.com
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: midnight commander  (Read 5240 times)
0 Members and 1 Guest are viewing this topic.
dayryad
Newbie
*
Offline Offline

Posts: 3


View Profile
« 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
Logged
macsat
Administrator
Sr. Member
*****
Offline Offline

Posts: 1,104



View Profile
« Reply #1 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 :-)


Logged
dayryad
Newbie
*
Offline Offline

Posts: 3


View Profile
« Reply #2 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
Logged
macsat
Administrator
Sr. Member
*****
Offline Offline

Posts: 1,104



View Profile
« Reply #3 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 :-)
Logged
dayryad
Newbie
*
Offline Offline

Posts: 3


View Profile
« Reply #4 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!
Logged
david07
Jr. Member
**
Offline Offline

Posts: 76


View Profile
« Reply #5 on: June 27, 2005, 20:56:01 PM »

Your "personal" export are done with /opt/etc/profile

(Check the file /etc/profile Wink )
Logged
macsat
Administrator
Sr. Member
*****
Offline Offline

Posts: 1,104



View Profile
« Reply #6 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
« Last Edit: June 28, 2005, 07:24:00 AM by macsat » Logged
david07
Jr. Member
**
Offline Offline

Posts: 76


View Profile
« Reply #7 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 Wink
and then do a :
Code:
flashfs save
flashfs commit

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

Have fun :-)

macsat
Logged
hlediks
Newbie
*
Offline Offline

Posts: 1


View Profile
« Reply #8 on: September 02, 2008, 11:48:35 AM »

Your "personal" export are done with /opt/etc/profile

(Check the file /etc/profile Wink )

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
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

English Steel 1.6 © Saxon North Technologies
Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.545 seconds with 23 queries.