Find the answer to your Linux question:
Results 1 to 3 of 3
Code: #!bin/bash echo "Deleting the themes you don't want!" sleep 2 echo " by D3ATH from Deaths Repo" ##### root test ##### # won't go any farther unless you're uid=0 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2012
    Posts
    12

    Theme Remover Script(Help!)


    Code:
    #!bin/bash
    echo "Deleting the themes you don't want!"
    
    sleep 2
    
    echo  "                 by D3ATH from Deaths Repo"
    ##### root test #####
    # won't go any farther unless you're uid=0
    [ `id -u` != 0 ] && exec echo "Oops, you need to be root to run this script"
    
    echo ".....removing WinterBoard Default Themes!"
    
    echo "…..now deleting themes!"
    
    cd /Library/Themes/
    rm -rf Black Navigation Bars.theme Dim Icons.theme Dim Wallpaper.theme No Docked Icon Labels.theme No Undocked Icon Labels.theme Solid Status Bar.theme Transparent Dock.theme User Lock Background.theme User Wallpaper.theme White Icon Labels.theme
    sleep 2
    
    echo ".....moving themes to var"
    
    mv /Library/Themes /private/var/ && ln -s /private/var/WinterBoard /Library/Themes
    echo "Finished deleting the themes you didn't want feel free to delete me I don't mind."
    
    sleep 3
    
    apt-get remove net.death.themeremover
    
    killall WinterBoard
    
    exit 0
    This is what I have however when I try to run it it says this:
    sh: /usr/bin/winterboard: bin/bash: bad interpreter: No such file or directory
    How do I fix this so I can have it working?
    Last edited by Death2020; 06-30-2012 at 01:08 PM.

  2. #2
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Slackware, {Free, Open, Net}BSD, Solaris
    Posts
    1,286
    Hi.

    Here is a driver script that lists 2 small test scripts, then executes them:
    Code:
    #!/usr/bin/env bash
    
    # @(#) s1	Demonstrate one reason for "bad interpreter".
    
    pe() { for _i;do printf "%s" "$_i";done; printf "\n"; }
    pl() { pe;pe "-----" ;pe "$*"; }
    db() { ( printf " db, ";for _i;do printf "%s" "$_i";done;printf "\n" ) >&2 ; }
    db() { : ; }
    C=$HOME/bin/context && [ -f $C ] && $C
    
    pl " Small script for testing:"
    cat -An hi-good.sh
    
    pl " Another small script:"
    cat -An hi-bad.sh
    
    pl " Permissions on files:"
    ls -lgG hi*
    
    pl " Executing good and bad by feeding into bash:"
    bash hi-good.sh
    bash hi-bad.sh
    
    pl " Executing good and bad with direct call:"
    ./hi-good.sh
    ./hi-bad.sh
    
    exit 0
    producing:
    Code:
    % ./s1
    
    Environment: LC_ALL = C, LANG = C
    (Versions displayed with local utility "version")
    OS, ker|rel, machine: Linux, 2.6.26-2-amd64, x86_64
    Distribution        : Debian GNU/Linux 5.0.8 (lenny) 
    bash GNU bash 3.2.39
    
    -----
     Small script for testing:
         1	#!/bin/bash$
         2	$
         3	echo " Hello, world (good) from bash."$
    
    -----
     Another small script:
         1	#!bin/bash$
         2	$
         3	echo " Hello, world (bad) from bash."$
    
    -----
     Permissions on files:
    -rwxr--r-- 1 50 Jul  1 05:19 hi-bad.sh
    -rwxr--r-- 1 52 Jul  1 05:19 hi-good.sh
    
    -----
     Executing good and bad by feeding into bash:
     Hello, world (good) from bash.
     Hello, world (bad) from bash.
    
    -----
     Executing good and bad with direct call:
     Hello, world (good) from bash.
    ./s1: ./hi-bad.sh: bin/bash: bad interpreter: No such file or directory
    Both files seem to execute when fed into the shell, but one fails when called directly.

    What do you see as the difference between the 2 scripts?

    Best wishes ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  3. #3
    Just Joined!
    Join Date
    Jun 2012
    Posts
    12

    Red face

    I did a complete rewrite of the script and here is what I have:

    Code:
    #!/bin/bash
    
    mkdir /var/mobile/Documents/WinterBoard
    sleep 3
    
    echo "I will move the unneeded themes in WinterBoard for you!"
    
    sleep 3
    
    echo  "Theme Remover by D3ATH from Deaths Repo"
    
    ##### root test #####
    # won't go any farther unless you're uid=0
    [ `id -u` != 0 ] && exec echo "Oops, you need to be root to run this script"
    
    echo ".....moving WinterBoard Default Themes!"
    
    sleep 2
    
    echo "…..now moving themes!"
    cd "/private/var/Themes/Black Navigation Bars.theme"
    mv "/private/var/Themes/Black Navigation Bars.theme" -b "/var/mobile/Documents/WinterBoard/"
    
    cd "/private/var/Themes/Dim Icons.theme"
    mv "/private/var/Themes/Dim Icons.theme" -b "/var/mobile/Documents/WinterBoard/"
    
    cd "/private/var/Themes/Dim Wallpaper.theme"
    mv "/private/var/Themes/Dim Wallpaper.theme" -b "/var/mobile/Documents/WinterBoard/"
    
    cd "/private/var/Themes/No Docked Icon Labels.theme"
    mv "/private/var/Themes/No Docked Icon Labels.theme" -b "/var/mobile/Documents/WinterBoard/"
    
    cd "/private/var/Themes/No Undocked Icon Labels.theme"
    mv "/private/var/Themes/No Undocked Icon Labels.theme" -b "/var/mobile/Documents/WinterBoard/"
    
    cd "/private/var/Themes/Solid Status Bar.theme"
    mv "/private/var/Themes/Solid Status Bar.theme" -b "/var/mobile/Documents/WinterBoard/"
    
    cd "/private/var/Themes/Solid Status Bar.theme"
    mv "/private/var/Themes/Solid Status Bar.theme" -b "/var/mobile/Documents/WinterBoard/"
    
    cd "/private/var/Themes/Transparent Dock.theme"
    mv "/private/var/Themes/Transparent Dock.theme" -b "/var/mobile/Documents/WinterBoard/"
    
    cd "/private/var/Themes/User Lock Background.theme"
    mv "/private/var/Themes/User Lock Background.theme" -b "/var/mobile/Documents/WinterBoard/"
    
    cd "/private/var/Themes/User Wallpaper.theme"
    mv "/private/var/Themes/User Wallpaper.theme" -b "/var/mobile/Documents/WinterBoard/"
    
    cd "/private/var/Themes/White Icon Labels.theme"
    mv "/private/var/Themes/White Icon Labels.theme" -b "/var/mobile/Documents/WinterBoard/"
    
    echo "All themes have been moved to /var/mobile/Documents/WinterBoard for when you want them back!"
    
    sleep 2
    
    echo "Finished…."
    
    sleep 3
    
    echo "PLEASE DO NOT DELETE ME BECAUSE IF YOU DO SO ALL DEFAULT WINTERBOARD THEMES WILL BE REPLACED"
    
    sleep 5
    
    echo "If you want the default WinterBoard themes back then uninstall me from Cydia and your themes will be replaced"
    
    sleep 5
    
    killall SpringBoard
    
    exit 0
    It works the way I want it to now.
    Last edited by Death2020; 07-01-2012 at 12:46 PM. Reason: Code change

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •