# I have telnet prompt but lost most basic commands, ls, ps, etc



## OrangeHair (May 28, 2006)

What gives? I recently activated Hackman and have been playing with bufferhack41 for Dtivo. I can only imagine I've somehow screwed up my author file...

Any direction would be appreciated.

Edit: Have I lost my "./profile" file? Found my /profile.bak file using Filezilla but didn't find the actual profile file. What is the best way to correct this, retweak? 

What's strange is that commands "rw" and "ro" still work. "cd" and "pwd" work but "ls" does not.


----------



## ttodd1 (Nov 6, 2003)

Sounds more like the path is missing.


----------



## OrangeHair (May 28, 2006)

forgive my ignorance. The path where and to what? Thanks for the response.

Has my author file omitted the path to the profile? Or do I need to modify my profile to includ a path to something? Where should the profile file be located?


----------



## ttodd1 (Nov 6, 2003)

There is a path statement in the author file that tells the system where to find commands. If the ro and rw are working then it sounds like the profile is fine.


----------



## rpdre1 (Feb 20, 2005)

You can't see the .profile file in FTP.

Check if your .profile really is gone in telnet:

cd /
ls .profile


----------



## OrangeHair (May 28, 2006)

todd1 and rpdre1, thanks for the input thus far. The path was not set in my hackman generated author file (along with a lot of other omissions). Once I typed,

export PATH=./:.:/utils:/bin:/sbin:/tvbin:/tivobin:/busybox:/enhancements

in the telnet prompt the commands that I was missing returned. And now I was able to do rpdre1's suggestion ("ls" wasn't working before) and the .profile file is indeed there.

Now my only question is how to fix my author file (yes, I know I'm a fool for not having a backup of my author file). Should I restore the rc.sysinit.author.ORIG file that I found on the tivo or should I augment the hackman generated author file? I prefer the later as I would like to continue using hackman.

The hackman generated file is as follows,


```
#!/bin/bash
#
# /etc/rc.d/rc.sysinit.author
# generated by hackman
# Saturday, December 23, 2006, 03:49 PM, local time
#
## ~~ Start of user section ~~ ##
# (Don't edit the ~'s and #'s!) #

### ~~ End of user section ~~ ###

# Start of hackman item generation
#
# Starting the TiVo Telnet application:
if test -f /sbin/tnlited
then
  /sbin/tnlited 23 /bin/bash -login > /dev/console &
fi
#
# Starting the TiVo FTP application:
if test -f /busybox/tivoftpd
then
  /busybox/tivoftpd &
fi
#
# Starting the TivoWeb application:
if test -f /TivoWebPlus/tivoweb
then
  /TivoWebPlus/tivoweb &
fi
#
# Starting the cron Scheduler application:
if test -f /busybox/crond
then
  /busybox/crond &
fi
#
# Starting the EndPadPlus application:
if test -f /enhancements/endpadplus.tcl
then
  /enhancements/endpadplus.tcl 1 2 -seq -auto >> /dev/null &
fi
#
echo '/etc/rc.d/rc.sysinit.author generated by hackman completed'
#
```
Obviously I should have realized that there is a "user section" and I need to add a bunch of stuff back in every time? These are the missing sections from the ORIG file,


```
echo "set environmental variables"
export PATH=./:.:/utils:/bin:/sbin:/tvbin:/tivobin:/busybox:/enhancements
export TIVO_ROOT=
export MFS_DEVICE=/dev/hda10

echo "starting serial bash"
/bin/bash </dev/ttyS2&> /dev/ttyS2&

echo "running fakecall"
fakecall.tcl
route add -host 204.176.49.2 gw 127.0.0.1
route add -net 204.176.49.0 gw 127.0.0.1 netmask 255.255.255.0

echo
if [ -e /reboot_flag ]; then
mount -o remount,rw /
if rm /reboot_flag; then
reboot
fi
fi

#############################################
# starting netserver to receive netperf requests
/enhancements/netserver

#############################################
# starting NCID CallerID
touch /var/log/cidcall.log &
cd /var/hack/sbin; ./ncidd
cd /var/hack/bin; ./tivocid &

# Check if var got wiped, and if so, rebuild symlinks from /enhancements/varhacks
if [ ! -e /var/vardelete_flag ]; then
	sh /enhancements/var-symlinks.sh
fi
```
It is fairly obvious what most of these new sections do (and obviously I want to re-add them to my author file). My question now becomes, can I paste all of this in my "user section" and have it work? I'm afraid to try it and have the reboot hang on me.

Specifically, I'm concerned about starting the serial bash (/bin/bash </dev/ttyS2&> /dev/ttyS2&) before the telnet gets started later down the file by the hackman generated author file.

Also, what does "fi" do? Should I be concerned about the order of execution of any of the other "user section" commands that I plan to paste in?


----------



## overzeetop (Jul 15, 2003)

Okay, I'd like to revive this a bit so see if anyone else has solved this problem. 

I have lost ls but seem to have everything else. I have ro and rw. My .profile exists. I've manually exported my path to what I thought it should be. FTP won't connect (using Core). 

I did mess with my rc.sysinit.author a while back when trying to get rid of softpadding (which is driving me crazy, and still ins't banished). With ls, I can find my way around, but I don't know the system well enough to do it blindly. Even joe works (not that I'm even close to proficient with it, but there are resources for that.)

Anyway, where should ls reside so I can go looking for it, and if it's not there is there an easy way to get it back?

TIA

re-edit: /hacks is still there, so I can probably get back to zero if I can figure out how to get ls back. With ls and can find my hacks and copy them back into the /var/hacks directory where the restof te system expects things to be. What is the full path for ls? FWIW, my tivo has been zippered, or very similar.


----------



## overzeetop (Jul 15, 2003)

Followup to my own post...

The solution to the missing commands was to go and install Alphas All-in-one all over again. That, plus adding the tivo-bin to my $PATH, got all the commands back, including ls (needed to keep my sanity...better than either echo * or having to add the busybox loc to my path and typing busybox ls when I needed it) and wget. The last allowed me to re-install the enhancements.


----------

