Question About Scripts

Discussion in 'Bugless' started by phaze3131, May 3, 2010.

  1. phaze3131
    Offline

    phaze3131 New Member

    Joined:
    Oct 28, 2009
    Messages:
    291
    Likes Received:
    0
    Trophy Points:
    0
    Hey guys I am just wondering the steps I need to take to run the "scripts" on peter has listed there like these:

    OPTIONAL Scripts: (credit to Pete)
    -blockads (blocks adds in apps & browser)
    -cpuinfo (shows [COLOR=#812528 ! important][COLOR=#812528 ! important]cpu[/COLOR][/COLOR] info)
    -droidboot (installs my custom boot animation *Decreases boot time*)
    -fixperm (use if script permissions are faulty)

    Thanks all!
  2. droiduser5
    Offline

    droiduser5 New Member

    Joined:
    Feb 27, 2010
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    0
    Granted you are rooted and running pete's ROM, open up a terminal emulator or adb terminal on your computer and type:
    ...etc. Aka just type the script with no hyphen. Any new session needs to start with the line:
  3. phaze3131
    Offline

    phaze3131 New Member

    Joined:
    Oct 28, 2009
    Messages:
    291
    Likes Received:
    0
    Trophy Points:
    0
    awesome thank you alot
  4. mikecolorama
    Offline

    mikecolorama New Member

    Joined:
    Nov 23, 2009
    Messages:
    459
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Valinda, CA
    is there somewhere where i can get a tut on how to use the script from BB. i've never tried it before, so any assistance would be appreciated. thanks
  5. AndyR83
    Offline

    AndyR83 New Member

    Joined:
    Apr 23, 2010
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    0
    I just installed BB and am attempting to run scripts but every time I type one I get "permission denied." This is after having doen su first and the command prompt is a # not a $. Any ideas?
  6. Se7enLC
    Offline

    Se7enLC New Member

    Joined:
    Nov 16, 2009
    Messages:
    1,263
    Likes Received:
    0
    Trophy Points:
    0
    So you're opening up terminal emulator, and typing "su". What are you typing after that, exactly, and what is the exact error message?
  7. AndyR83
    Offline

    AndyR83 New Member

    Joined:
    Apr 23, 2010
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    0
    Here's a transcript:
    =============

    export PATH=/data/local/bin:$PATH
    $ $ su
    # blockads
    blockads: permission denied
    # droidboot
    droidboot: permission denied
  8. jayman350
    Offline

    jayman350 New Member

    Joined:
    Jan 8, 2010
    Messages:
    845
    Likes Received:
    18
    Trophy Points:
    0
    Location:
    Lowell, Ma
    aren't you supposed to put the system into read/write after the su command?

    When I have run scripts (VERY few times) it has gone something like this

    su
    sysrw
    **script you are trying to run**

    sysro (to put it back to read-only)
  9. Se7enLC
    Offline

    Se7enLC New Member

    Joined:
    Nov 16, 2009
    Messages:
    1,263
    Likes Received:
    0
    Trophy Points:
    0
    The script does the /system remounting for you:

    Code:
    #!/system/bin/sh
    # blockads - Blocks ads in Browser and Apps
    
    mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
    busybox mv /system/xbin/hostsblock /system/etc/hosts
    busybox cp /system/etc/hosts /system/xbin
    busybox mv /system/xbin/hosts /system/xbin/hostsblock
    mount -o remount,ro -t yaffs2 /dev/block/mtdblock4 /system
    sync
    echo 'Ads have been blocked'
    echo 'Bugless Beast by Pete'
    
    For the life of me, I can't figure out what on EARTH this script is supposed to be doing. The idea behind adblocking is that you replace the system hostfile (/system/etc/hosts) with one that remaps known ad servers with localhost (127.0.0.1).

    This adblock script moves /system/xbin/hostsblock to replace /system/etc/hosts, then copies that SAME FILE to the /system/xbin directory, then MOVES THE SAME FILE BACK to /system/xbin/hostsblock.

    Showads is just as cryptic - it moves a "hostsshow" file to /system/etc/hosts, then copies it to /system/xbin, then copies it back to hostsshow again.

    Why not just one single cp command that copies hostsblock or hostsshow to /system/etc/hosts?
  10. AndyR83
    Offline

    AndyR83 New Member

    Joined:
    Apr 23, 2010
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    0
    # sysrw
    sysrw: not found
    #