Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 28 Apr 2015, 12:16
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
mybin: script for tinkering
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message

Joined: 18 Feb 2008
Posts: 43

PostPosted: Tue 24 Mar 2009, 18:11    Post_subject:  mybin: script for tinkering
Sub_title: set permant path on usb or any folder to /root/mybin

hi there!

This is my script i call 'mybin'

what does it do?

I mainly use muppy 084c. I do alot of tinkering and testing for personal learning. This often means I mess something up along the way so I use live sessions with a setup script I made.

such as I have a packages I've made for installing needed items with out having to remake my pup_XXX.sfs. like my ipw2200patched drivers to set it in monitor mode,lcd brightness, wifi connections, different conky configs, wallpaper, etc...does matter, used right, live or saved I feel @home!

take a look and let me know, this is just something I personally use and will continue to add new elements, I alreadyhave ideas but won't say until I get them working.

... and it's colored for visual confirmation successful green, warning red Smile

as configured mybin will
copy itself to /usr/sbin. you can configure it to symlink
create a path to /root/mybin
symlinks /root/mybin to the directory you executed mybin from (like on your usb).

if it is run from another directory after installed, it wil warn you and need confirmation to change the symlink.


##This script will create a symlink to the running directory
# if you run like to run puppy from a usb install this is great
# for having a sort of permanent bin directory working on a live
# or saved session.
# if a symbolic link exist already, it will check if to see if the
# current directory is already set as $HOME/mybin, if not, it will
# warn you, show the target for $HOME/mybin and require user input
# of "y" or "n" to continue.
#a though of |v|@(


#set -x

eN="echo -e \033[0m"
erN="echo -e \033[0m \033[31m"
erB="echo -e \033[0m \033[1m \033[31m"
erbB="echo -e \033[1m \033[31m \033[40m"
egN="echo -e \033[0m \033[32m"
egB="echo -e \033[0m \033[1m \033[32m"
egbB="echo -e \033[1m \033[32m \033[40m"

CKPATH=$(cat $HOME/.bashrc | grep '#mybinPATH')

#checks for PATH and symlinks or copies script to /usr/sbin
if [ "$CKPATH" = "" ]; then
echo "adding PATH to $HOME/.bashrc"
echo "" >> $HOME/.bashrc
echo "$FLAG" >> $HOME/.bashrc
echo "PATH=$PATH:$HOME/$MYB; export PATH"  >> $HOME/.bashrc
test -e $TRGT
if [ "$?" = "1" ]; then
#link --
echo "creating"
ln -v -s $P2D/$MYB $TRGT

#or copy
##cp $P2D/$MYB $TRGT
##echo "$P2D/$MYB copied to /usr/sbin"

#mybin setup
echo "------------------------"
echo "|Set $HOME/$MYB symlink|"
echo "running in directory:"; ${eN}
echo "$P2D"

echo "Does $HOME/$MYB exist?"

if [ -d $HOME/$MYB ]; then ${eN}
echo "YES"
echo "checking $MYB symlink"

mlink=$(ls -l $HOME/$MYB | awk '{print $10}')

 if [ $mlink == $P2D ]; then ${egB}
 echo "$MYB is symbolic to:"
 echo "$mlink"
 echo ""
 echo "no need to change"
 echo "EXITING"

else ${erB}
echo "$MYB is not Symbolic to:"
echo "$P2D"
echo "$HOME/$MYB links to $link"
echo "if you continue, the symlink for $HOME/$MYB will be changed to:"
echo "$P2D"
echo "y to continue, n to cancel"
echo "(y/n)"
read input

 if [ $input = y ]; then ${erg}
 rm $HOME/$MYB
 ln -f -v -s $P2D $HOME/$MYB
 echo "EXITING"
 echo ""
 elif [ $input = n ]; then ${erbB}
 echo "User Canceled"
 echo "EXITING"


else ${eN}
echo "no"
ln -v -s $P2D $HOME/$MYB
echo "All Done"
echo "EXITING"
echo ""


. $HOME/.bashrc

#end of thought
Back to top
View user's profile Send_private_message 

Joined: 18 Feb 2008
Posts: 43

PostPosted: Tue 24 Mar 2009, 18:47    Post_subject:  

here is a pet I made with mybin

it does not register with petget simply since I have not done a uninstall script.

if you like here it is

Filename  mybin.pet 
Filesize  1.27 KB 
Downloaded  198 Time(s) 
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot attach files in this forum
You can download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0514s ][ Queries: 12 (0.0040s) ][ GZIP on ]