SManager - script executing fine manually, but not at boot - General Questions and Answers

Greetings! I know there have been many topics on how to run scripts at boot time, most suggesting the safe way using Script Manager. But I'm encountering an odd issue:
I installed dropbear via opkg as described here and I wrote a script that would execute as root and start it. The script executes fine when I run it manually (either from SManager or from my terminal emulator using sh) and I am able to connect to my phone via ssh. However, when I set SManager to run the script at boot, the script executes fine, the processes are running (I can see them in the output of ps), the output from the processes (saved to log files) is the same as when I run them manually (and the connection can be established), but there is no TCP port associated with dropbear. I check using netstat - when I run the script manually, I can see the listening port, but not when the script is run automatically. Consequently, I cannot connect to my phone even though dropbear is running and reports it's listening on the port I specified. I tried adding a 2 minute delay in the script before dropbear is started (to allow the device to fully boot up) and I can confirm dropbear is started well after every other process, but the result is the same. I'm not sure if this is a problem with dropbear, SManager or something else.
I tried putting the script in /etc/init.d and making it executable, but it is not being run at all, I don't think scripts there are being read (there is no such entry in /init.rc that checks scripts in /etc/init.d).
I'm running SlimBean 4.2.2 on Samsung Galaxy S with 3.0.71-Semaphore_JB_2.9.18s kernel. Here follows the script:
Code:
#!/system/bin/sh
# dropbear and ssh are installed in /data/local/bin
export PATH=$PATH:/data/local/bin
sleep 1s
dropbear -p 42549 -v &>/sdcard/droplog
sleep 1s
# set up remote port forwarding (reverse ssh) to my PC so I can connect to my phone through its network's firewall
ssh -TfN -o "GlobalKnownHostsFile /data/.ssh/known_hosts" -p 4713 -R 4714:localhost:42549 [email protected]<my-PC's public IP address> &>/sdcard/sshlog &

anyone?

bump, anyone? Sorry if this is not in the right section of the forums

(delete)

Related

[SCRIPT] Android-Linux Tools v0.2 for Linux [[Suggestions Needed]]

Okay. If this is not where the MODs want this post, please move it.
[UPDATE] - Jump over to Post #12 for some of my recent ideas and changes for this application.
I have been using mods for the G1 and the myTouch 3G for a little while now. I have used Backup for Root, and I use Nandroid. I created just a little simple script to backup your device to your linux-based machine and restore from there too. The concept behind this is having your backup on your computer, not your sd-card. Please, feel free to contribute. (If this is not your cup of tea, please do not leave a comment). I am limited on time, and wanted to contribute a little to the community. All this script is a compilation of adb commands. Anyone could compile these commands, I just wanted it organized and in one place.
README
After using all of the backup tools for root, I have ran into random FCs and bugs. This script uses Android SDK's adb tool and was designed to be simple. This script goes through and backs up your applications, bookmarks, sms, alarm clocks, settings, launcher settings and dictionary. There are plans for this script to be interactive in the future. As for now, it is a very basic script that will backup your device then restore your device.
Notes. As for now this script requires sudo. On every other linux pc tested, sudo was required (maybe because user did not install adb correctly?). This will change in future versions.
= Details =
REQUIREMENTS
1. Android SDK Toolkit 1.5 or higher
2. Bash v4.0.33
3. Root access to your device
4. Root access to your pc
HOWTO
Backing-Up
1. Plug your device in
2. Open command-line (On PC)
3. Run ./abrtool -b
4. Done.
Restoring
1. Reboot from flash of rom (Enter credentials and let phone setup first)
2. Open command-line (on PC)
3. Run ./abrtool -r
4. Restart device
5. Done
Changelog
Version 0.1.5
- Merged into Android-Linux-Tools (alt)
- Changed zenity commands (shows restore progress)
- Option to restart device after restore
- Can install abrtool via command-line (./abrtool --install)
Version 0.1.4
- Added Icons
- Runs Fix Permissions after restoration of applications
Version 0.1.3
- Fixed Restore (Again) - Sets $BACKUPDIR as $PATH
Version 0.1.2
- Restore applications now uses adb install instead of push
Version 0.1.1
- Fixed Restore arugement (-r restores now)
Version 0.1
- Created initial script
- Creates backups for Apps, Sms, Bookmarks, Alarms, Settings, User Dictionary, and Launcher
- Restores device
Download
Project Page for Android-Linux-Tools (ALT) http://code.google.com/p/android-linux-tools
Project Page for abrtool http://code.google.com/p/abrtool
Download abrtool ConvertVideoToAndroid
Download InstallOnAndroid Nautilus Script
InstallOnAndroid
Disclaimer
I am not responsible for anything. Anything at all. I'm just not. Blame someone else if something goes horribly wrong.
[Reserved]
[Reserved for future post]
Nice script but bart.sh can accomplish a full backup of your Android environment for restoration at a later date. While it does it to the SD card initially, these "barts" can easily be copied to any computer. I can, however, see a use for this as it serves a slightly different purpose. Thanks.
I wasn't sure what response I would get to this post. I have had to flash, partition, format, wipe.. enough times that I just wanted to plugin into my computer, backup, wipe-flash then restore. Thanks!
nice. I don't use linux myself, but i see the point of having the backup else where (not an SD card attached to the phone itself).
will this, in theory be made to work on windows? Cause that will be awesome.
@str4vag It would be really simple to just use a .bat file for Windows. I don't have any plans on making a windows script anytime soon. Sorry. Same commands especially though.
This is exactly what I've been looking for, now I just need to mod it to sync apps/bookmarks/etc automatically whenever I plug in my phone, and to only sync the new items to keep it speedy, great work dev!
@ggolemg I can play around with some "real" features soon. I plan on having it archive your backups and allow you to select which backup (default is most recent) you would like to use. I am sure I can play around with your idea too. Thanks.
subscribing to the thread, idea is very interesting. i've been looking for a foolproof way to backup and restore bookmarks, sms messages, and different alarms, without all the issues of backup for root users. gonna check out the script tonight.
Update coming by the end of the week.
- Will only backup apps not already backed up.
- Possibly apply the Python interface I have developed.
- More goodies.
How about switchrom?
Android-Linux-Tools
Okay, so this week has been crazy for me. (Mind you I am a restaurant manager first and a developer (primary web) second). I think I am going to gear this project in a different direction. First off, I have created GTK2 Dialogs and a settings panel for this application. I would like to gear towards general linux tools on the pc side. So over the next two weeks you can expect,
- Graphical Interface for abrtool (Android-Backup-Restore)
- Configuration for each application.
- Nautilus Scripts for all applications.
- Right-Click to Encode Video (With GTK2 Dialog progress)
- Right-Click to Install APK (With GTK2 Dialog progress)
- Right-Click to Sign APK (With GTK2 Dialog progress)
- Right-Click to Copy Files to SD Card
- abrtool will backup to Ubuntu One Cloud (Simple adb pull ~/Ubuntu\ One/? or maybe play with the API?)
Ideas and Possibilities
- User.conf editor
- Select with applications to backup
- Switchrom features?
Any other thoughts or suggestions are welcome. I want to start simple, keep working on the abrtool and then make my way out to some other useful tools for us linux (Ubuntu) users. Let me know what you think and what would be helpful.
i had to make a bynch of edits so this dosent run as root, id recomend everyone do the same, only run root when you must. Also changed ,.adb to adb so i dont have to run it in my android sdk dir
@ahronzombi Can you post those changes?
I am a firm believer of only running root when needed, Like I mentioned before I don't really have a huge amount of time, and when I tested this on a friends notebook adb required root to atleast kill-server then you could perform shell/push/pull.
AFAIK, adb server only requires root if ou haven't set the proper udev rules for the device.
Exactly. If we want this script to run universally we cannot rely on all users to have added the udev rules. If they don't they have to run sudo. Maybe a quick check for the udev file then sudo if not?
boulderjams said:
Exactly. If we want this script to run universally we cannot rely on all users to have added the udev rules. If they don't they have to run sudo. Maybe a quick check for the udev file then sudo if not?
Click to expand...
Click to collapse
no i think it would be wise to have people understand there udev permissions rather than run root so its universal. that kind of thinking leads to very big security problems. with root in the script most of the simplest linux users could exploit anyone
I fully understand that. Do you mind posting your changes to the script?
this is the secure version of the script that dosent run as root
keep in mind i set my own adb and home directorys so you'll have to change those
Code:
#! /bin/bash
# abrtool version 0.1
# Last Updated Wednesday, November 18, 2009
# Android Backup Data and Restore Data Script
#TODO
# 1- See if config file exists
# 2- If not, create config file (for now, select directory to backup to)
# 3- See if arguments are specified
# 4- If not, return an error via dialog
# 5- If argument -b exists, run backup
# 6- If argument -r exsists, run restore
export PATH=${PATH}:/home/ahron/android/android-sdk-linux/tools:/home/ahron/android/abr
BACKUPDIR=/home/ahron/android/backups
USER=${username-`whoami`}
backupscript() {
export PATH=$PATH:$BACKUPDIR
adb kill-server
adb pull /system/sd/app $BACKUPDIR/apps
adb pull /system/app $BACKUPDIR/apps/device
echo "---------- Backed Applications"
adb pull /data/data/com.android.providers.telephony/databases/mmssms.db $BACKUPDIR/msgs/mmssms.db
echo "---------- Backed Text Messages"
adb pull /data/data/com.android.browser/databases/browser.db $BACKUPDIR/bookmarks/browser.db
echo "---------- Backed Bookmarks"
adb pull /data/data/com.android.alarmclock/databases/alarms.db $BACKUPDIR/other/alarms.db
adb pull /data/data/com.google.android.providers.settings/databases/googlesettings.db $BACKUPDIR/other/googlesettings.db
adb pull /data/data/com.android.launcher/databases/launcher.db $BACKUPDIR/other/launcher.db
adb pull /data/data/com.android.providers.userdictionary/databases/user_dict.db $BACKUPDIR/other/user_dict.db
echo "---------- Backed Other Settings"
chown -R $USER $BACKUPDIR
zenity --info --text "Successfully Backed-up to $BACKUPDIR"
}
restorescript() {
export PATH=$PATH:$BACKUPDIR
adb kill-server
#sudo adb push $BACKUPDIR/apps /system/sd/app
echo "----------- Installing Applications"
cd $BACKUPDIR/apps
for searchfile in ./*.apk
do
echo "------------ Processing $searchfile"
sudo adb install "$searchfile"
done
echo "---------- Restored Applications"
adb shell su
adb shell fix_permissions
echo "---------- Fixed Application Permissions"
adb push $BACKUPDIR/msgs/mmssms.db /data/data/com.android.providers.telephony/databases/mmssms.db
echo "---------- Restored Messages"
adb push $BACKUPDIR/bookmarks/browser.db /data/data/com.android.browser/databases/browser.db
echo "---------- Restored Bookmarks"
echo "---------- (Please, make sure to restart your browser)"
adb push $BACKUPDIR/other/alarms.db /data/data/com.android.alarmclock/databases/alarms.db
adb push $BACKUPDIR/other/googlesettings.db /data/data/com.google.android.providers.settings/databases/googlesettings.db
adb push $BACKUPDIR/other/launcher.db adb pull /data/data/com.android.launcher/databases/launcher.db
adb push $BACKUPDIR/other/user_dict.db /data/data/com.android.providers.userdictionary/databases/user_dict.db
echo "---------- Restored Other Settings"
zenity --info --text "Successfully Restored Android device from $BACKUPDIR"
}
if [ "$#" -eq 0 ]
then
echo "Usage $0"
echo " -b Backup"
echo " -r Restore"
exit $E_OPTERR
fi
set -- `getopt "br:" "[email protected]"`
while [ ! -z "$1" ]
do
case "$1" in
-b) backupscript;;
-r) restorescript;;
esac
shift
done

OpenVPN with Root - Updated 8/19

Easy way - OpenVPN on rooted/S_OFF Incredible with BusyBox installed:
This is by far the easiest way to set up OpenVPN. Make sure you copy your config file and any relevant keys to a folder on your sdcard. First, you need to know where BusyBox is installed, and if you already have the tun.ko module. For BusyBox, for most Roms based off the 2.2 8/1 leak, the location is /system/xbin. An easy way to check on your phone:
adb shell
find / -iname "iptunnel"
The path containing the file is where BusyBox is installed. If you don't have it installed, you can follow the instructions at the bottom of this post to install it.
The tun.ko module depends on your kernel. With the hydra 2.2 kernels, the location is /system/lib/modules/tun.ko . Easy way to check:
adb shell
find / -iname "tun.ko"
If you do not have tun.ko on your system, then you can download it for 2.2 (tun.zip) or 2.1 (inside openvpn.zip) attached to this post.
Next, download the following two apps from the Android Market:
OpenVPN Installer
OpenVPN Settings
Next, run OpenVPN installer, click install, give it an install path (I prefer /system/xbin), and give it the path to BusyBox.
Finally, run OpenVPN Settings. Go to Menu -> Advanced, make sure "Load tun kernel module" is checked.
Click on "TUN module settings"
Change "Load module using" to insmod
Change "Path to tun module" to... the path to your tun.ko file. Click back.
Update "Path to configurations" and "Path to openvpn binary".
That should be it!
This is how to run OpenVPN on a rooted Incredible using unrEVOked root and the stock 2.1 ROM with S_ON
NOTE: This is only for rooted Stock 2.1 without S_OFF. If you have S_OFF via unrevoked forever, just use Openvpn Installer and Openvpn Settings, both available in the market. Much easier!
This is my first time doing something like this, so bear with me if it is a little rough!
You must have root access to set this up. You do NOT need to go back into recovery adb though.
First, download the attached openvpn.zip containing the following:
tun.ko - kernel module for 2.1.
openvpn-static - statically compiled openvpn
If you are using 2.2, tun.zip contains the module compiled for the 2.2 kernel (thanks Apalyan!)
You will already need to have a working client.conf, and any associated keys. Copy the following files into a folder named 'openvpn' on the sdcard, or push with the following:
adb mkdir /sdcard/openvpn
adb push tun.ko /sdcard/openvpn/tun.ko
adb push client.conf /sdcard/openvpn/client.conf
adb push client.key /sdcard/openvpn/client.key
adb push client.crt /sdcard/openvpn/client.crt
adb push ca.crt /sdcard/openvpn/ca.crt
adb push openvpn-static /sdcard/openvpn/openvpn-static
The following must be done in a root shell:
adb shell
su
mkdir /data/openvpn
dd if=/sdcard/openvpn/openvpn-static of=/data/openvpn/openvpn
chmod 700 /data/openvpn/openvpn
Use the OpenVPN Settings configuration below to start/stop openvpn.
Note: All of the code was already written and ported to Android by the guys behind OpenVPN Settings. I just compiled a new tun.ko from the Incredible kernel source, and recompiled the statically linked openvpn with updated paths to ifconfig and route.
ADDED (thanks wraithdu!):
If you have trouble with post-connection routing, you may need to install busybox for a more powerful route/ipconfig. Instructions are here:
---
busybox is installed by the latest rooting process, but it's not a full install, ie it does not create all the command links. I got the file from the Titanium Backup site:
http://www.matrixrewriter.com/android/files/busybox-1.15.3.zip
To install:
1) extract and push busybox to your sdcard, reboot into recovery
2) mount /system
3) if you don't have /system/xbin (you should), create it
adb shell:
# mkdir /system/xbin (if necessary)
dd if=/sdcard/busybox of=/system/xbin/busybox
cd /system/xbin
chmod 755 busybox
./busybox --install .
4) reboot and done
OPTIONAL - before rebooting replace the busybox installed by the root process in /system/bin
1) mv /system/bin/busybox /system/bin/busybox.bak
2) cp /system/xbin/busybox /system/bin/busybox
OpenVPN Settings Instructions
OpenVPN Settings v. 4.6 works flawlessly with this! Here are setup instructions:
Install OpenVPN Settings v. 4.6 from:
Can't post links yet, do a google search for OpenVPN Settings, go to the Google Code download page, and download version 4.6.
Then, launch OpenVPN Settings, press Menu -> Advanced, and fill in the following settings:
Load tun kernel module - Checked
TUN module settings:
Load module using - insmod
Path to tun module - /sdcard/openvpn/tun.ko
Path to configurations - leave default
Path to openvpn binary - /data/openvpn/openvpn
It should work beautifully then.
any way to do it with non certicate based connections? i.e., group/psk configs?
The certificate setup isn't important, it is just how mine is set up. Any valid .conf should work.
ifconfig error
i got it all installed , it connects, but then in the end it says fatal error, ifconfig failed, could not execute external program. any ideas
You can run it manually to see what exactly is happening. Try the following:
adb shell
su
/data/openvpn/openvpn --config /sdcard/openvpn/client.conf
What generates the error?
error
Wed Jun 16 08:52:50 2010 /system/xbin/bb/ifconfig tap0 192.168.200.2 netmask 255
.255.255.0 mtu 1500 broadcast 192.168.200.255
Wed Jun 16 08:52:50 2010 Linux ifconfig failed: could not execute external progr
am
Wed Jun 16 08:52:50 2010 Exiting
and ifconfig is under /system/bin not /system/xbin/bb/. do you guys know where i need to change that?
The ifconfig stuff is hardcoded. I uploaded the wrong version - try this one.
Works perfectly
THANK YOU , works great
fang0654 said:
The ifconfig stuff is hardcoded. I uploaded the wrong version - try this one.
Click to expand...
Click to collapse
Thanks very much for this! Will be trying it later today.
Fang - Thanks again. Do you have any suggestions on a util or tutorial on making a conf file? I've access to our Cisco ASDM for our ASA, the URL for the ASA, group name, Group key, and of course my username and pw.
For that, you need vpnc instead of openvpn.
I know the problem with using the VPN Connections app is that the tun.ko autoload doesn't work. There are a couple of things you may be able to do as a workaround.
1. Load the module by hand:
adb shell
su
insmod /sdcard/openvpn/tun.ko
or 2. Use the OpenVPN Settings app from above to load the tun module (just start openvpn, then stop it), then try out the VPNC app.
I don't have a Cisco vpn so I don't have any way of testing whether this works.
Gets "failed to connect" immediately. know of any way to launch the vpn connections via command line to see where it is failing?
This worked like a charm! Thanks very much for this guide.
Stupid question, how do I get to a adb shell? I already rooted the phone. I don't have to do the rooting process all over do I?
If your running Linux, just type "adb shell" in you terminal window - make sure your phone is connected via USB cable - you should get the "$" after this command and then your in your phone's shell.
I believe windows is the same way, but I only have Linux stuff running now...
Thanks a lot for putting this together!
mattwood2000 said:
If your running Linux, just type "adb shell" in you terminal window - make sure your phone is connected via USB cable - you should get the "$" after this command and then your in your phone's shell.
I believe windows is the same way, but I only have Linux stuff running now...
Click to expand...
Click to collapse
With the phone connected via USB (Disk drive or anything), I type "adb shell" and get device not found. I'm running Windows 7. Phone has been rooted (have Wifi Tethering installed). Just having issues getting it back to the shell command like when I first rooted it :/
make sure USB Debugging is enabled
OK, had a misspell in the tun.ko file.
I'm connected now. But unable to connect to anything on my network. Still looking into it.
Any ideas? I've restarted the phone. I'm connected to my OpenVPN server. I cannot ping the IP assigned to it (from OpenVPN status page). I cannot ping anything on my internal network from the shell. Shows no data moving. Do I need to do something?
I did a netconf and i have this:
tap0 UP 172.30.100.255 255.255.0.0 0x00001043

[Q] OpenVPN on the Charge?

Dear All,
Does anyone have OpenVPN working on the Charge? I have PeanutButta Jelly Time which is suppose to have the tun.ko module in the kernel and lsmod gives me tun. however installing openvpn using the installer and settings does not work. I followed all the instruction including the push of openvpn2.1.1, sym linking of ifconfig and route, as well as various tun.ko files, but it fails to start. any thoughts?
Elviso
I am also interested in this
bump .. +1 .. anyone?
Please use the Q&A Forum for questions Thanks
Moving to Q&A
I finally got it working on mine. GummyCharged FE 2.0.
1) Install GummyCharge FE 2.0 ROM.
2) Install latest Imoseyon kernel. I don't think you need this since GC comes with the Imoseyon kernel #130 which should already have TUN support, but I upgraded mine anyway. After kernel upgrade mine was at #141. Link: http://rootzwiki.com/showthread.php...leanKernel-minimalistic-kernel-(v1.2.2-9-8-11)
3) Install Busybox.
4) Download bnred777's tun.ko from here: http://forum.xda-developers.com/showthread.php?t=1235410
5) Create a direcotyr called /system/lib/modules/ and /system/xbin/bb/
6) Copy tun.ko to /system/lib/modules/
7) Create a directory on your sdcard called /openvpn and copy all of your ovpn config and certificates there.
8) Install OpenVPN Installer from the market.
9) Run OpenVPN Installer and choose target directory of /system/xbin and /system/xbin/bb for ifconfig.
10) Create symlinks in the /system/xbin/bb/ directory:
ln -s /system/xbin/ifconfig /system/xbin/bb/ifconfig
ln -s /system/xbin/route /system/xbin/bb/route
11) Reboot your phone.
12) Run the following command from shell. You will have to run this every time you want to connect to your vpn. I would suggest making a shortcut shell script or there is probably a way to put it in start up.
insmod /system/lib/modules/tun.ko
13) Install OpenVPN Settings from the market. It should pick up your configuration settings from your sdcard/openvpn directory automatically.
14) Put in your password and you should be connected to your VPN.
The instructions are pretty much the same as other droid devices except for the Charge you need a Charge compiled tun.ko and getting the less finicky directories and symlinks took me a while to figure out. Here is a thread that helped me out with the directories and symlinks:
http://code.google.com/p/android-openvpn-installer/issues/detail?id=2

Terminal and SSH access

As a new Android user but experienced in Linux I wanted to explore the command shell. I've wanted to change passwords and have use the usual commands I would normally expect to be available.
I'd like to share my experience for any other new user and open the discussion for for additions and corrections. What I say here works on a Galaxy Mini S5570 but should be pretty generic. This really does need the phone to be rooted or much will be inaccessible.
Comparing 3 methods Terminal Emulator, DigiSSHD which is run from DigiControl and SSHDroid.
There is no concept of a root password as access is granted via superuser app. When you connect your id is set from the id of the app you are using to connect.
The simplest connection is via Terminal Emulator. It requires no network connection and gives direct access to the phone. The first thing is that you have no home directory so you are dumped into / the top directory. There is no .bash_profile, .bashrc or .profile so it's customisation is not obvious.
I tested SSHDroid and DigiSSHD using wi-fi. My ssh client was the excellent Putty on Windows7.
As default SSHDroid uses port 22 while DigiSSHD uses port 2222.
For a rooted phone SSHDroid has user "root" with password "admin". This is not your device's root password. You can think of it as an access password for SSHDroid. This access password can be changed in the options for SSHDroid. It is a good idea to do so stop others getting in just as you have done.
You arrive in a home directory data/data/berserker.android.apps.sshdroid/home and inside there you will find a .profile file so you can do some customisations there. The good news is that all the usual linux functions are available in ~/bin via the PATH variable it gives you and its own busybox.
Neither Terminal Emulator nor DigiSSHD give you these functions but this is a good way to do it.
Terminal Emulator by default gives you a PATH which includes /data/local/bin. This is set by Initial Command in the Preferences but I'm taking it as it is.
There was no directory /data/local/bin. This is good because we can create it and put our own stuff in there wihout having inconsistent clashes. Create it with the correct permissions. Copy the permissions of another directory in the path in my case I used /system/bin. To check the permissions:
cd /system
ls -l
The permissions were for bin are drwxr-xr-x with Owner/Group of root and Shell. So create the new directory.
cd /data/local
mkdir bin
chmod 755 bin
chown root.Shell bin
Now you can start creating your utilities. Before you do check that each is not already available by trying to run it. It might already be provided by Toolbox. To see what busybox can do type
busybox --help
To get your utility, assuming it is available in busybox create a symlink to busybox with the name of the utility. As an example this is how to create 'more' and 'less' and the standard 'vi'
cd /data/local/bin
ln -s /system/xbin/busybox more
ln -s /system/xbin/busybox/less
ln -s /system/xbin/busybox/vi
You can carry on activating your favourite utilities. Remember to check if it already there first and NEVER forget you are doing all this as root so take care...
Why do it this way and not use the functions provided by SSHDroid? Well as an ordinary user you may not have access and if you decide to uninstall SSHDroid you would probably lose it.
Now for DigiSSHD. The default user is android with a password of 123. I have not found how to change this yet so comments welcome. Your home directory will be something like /mnt/sdcard/Android/data/org.digimead.digi.ctrl/files/var/1d7a337e-7cf8-4b28-8039-baa894f7185f
There is a .profile file in your home directory that you can edit and add the line
export PATH=/data/local/bin:$PATH
This will give you access to the same utilities (so same versions) as you have with Terminal Emulator.
That's it. The rest is up to you. Which utilities you chose and which command line app suits you. I doubt that all the busybox functions will work on an Android system because it is not an ordinary Linux.
Which is better, SSHDroid or DigiSSHD? I don't know. I'll leave that for others to comment.
Are you the admin on this other site? Terminal and SSH Access Just curious as this is exact copy/paste post from that post with no links or attributions.

[How To][Linux] Optware + ssh + samba + transmission + flexget

Yep, you read that correctly. I have optware, ssh, samba, transmission, and flexget working on my Minix X5 Mini. This should work for any rooted device which has an adb connection enabled. This will work on the original ROM. In fact, I use the stock ROM. For those not using a Minix device this should work on any ARM device. Sorry but all the binaries are built on ARM.
JUST AS EVERY OTHER DEVELOPER: I AM NOT RESPONSIBLE IF YOU BRICK YOUR DEVICE! MAKE A BACKUP!
Requirements:
Linux box with adb (don't ask me about windows, I don't support bad habits)
clockworkmod (for a backup)
root
internet connection
Process:
Make a backup of your ROM!
Download files (gitHub)
You have two options here:
Download the zip via https://github.com/erichlf/AndroidSeedBox/archive/master.zip and unzip it.
Clone the repo using git via 'git clone [email protected]:erichlf/AndroidSeedBox.git'
Make script executable
chmod +x optware-etc.sh
Obtain adb connection to device (covered in another thread)
Gain root access on local machine (adb seemed to require this for things to work)
sudo su
Run script and follow directions
./optware-etc.sh
Use SManager to run /opt/home/root/sysinit at every restart.
Notes:
The script can be modified to change the various programs that I install. You could exchange transmission for deluge for example.
Transmission can be accessed from the minix through localhost:9091 or from some other machine using your ip-address and the port 9091. If that doesn't work you should edit the config file located at /opt/home/root/.config/transmission-daemon/settings.json
username: root
password: you provided this in the install script
Without SManager nothing will start automatically. However, if you have a ROM which has init.d support you can move the scripts in /opt/etc/init.d to /etc/init.d I would suggest maybe linking the two instead of just moving the scripts or possibly adding a script to /etc/init.d which runs the items in /opt/etc/init.d The reason is because when installing things using ipkg the startup scripts will be placed in /opt/etc/init.d and not /etc/init.d However, it is extremely important that optware is started, and this is partly what sysinit accomplishes.
To list available packages
ipkg list
To install a new package use the command
ipkg install <new package>
To remove a package use the command
ipkg remove <package to remove>
cron is weird and I couldn't get it to work like it should, but I got it to work
While on the Android device (ssh or terminal emulator)
Create a .crond file in the home directory of your device (/opt/home/root/) with some schedule in it. Remember to leave a blank line at the end of the file.
Tell cron about the .crond file
crontab -u root /opt/home/root/.crond
Make sure cron sees the cron file
crontab -l
If you want to edit your cronfile use a text editor and edit the file directly and then tell cron about the file again.
Many things are installed in what seem like strange places, so use
which <binary you are looking for>
Feel free to help develop the code. I think what would be best is an update.zip or a CWM flashable zip. Right now I don't know how to do this, but once I get more time I will look into it. So, any help on this front is welcomed.
Enjoy!
I really wish you would have kept the repo up. It seems kind of pointless to go through all that trouble just to delete the repo and leave people wondering what you did.
I have been busy and didn't update this particular post, since there had been no activity on it.
git clone [email protected]:erichlf/androidseedbox.git
https://bitbucket.org/erichlf/androidseedbox/get/master.zip
Sorry, I didn't need to be rude. I was just excited to find this and then sad when it was gone. Thanks for pointing me in the right direction!

Categories

Resources