[SOLVED] How to get BASH scripts to recognize mounted partition paths?

I don't understand how to get the bash script in the root partition to find the boot partition--both mounted at /mnt.
I'm following the instructions on configuring "dm-crypt with LUKS" tutorial. The mkinitcpio command to generate the "initial ram disk environment" is producing an error while the system is booted from the install disk and the volumes it looks for are mounted at /mnt.
#mkinitcpio -p linux
==> Building image from preset: /etc/mkinitcpio.d/linux/preset: 'default'
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> ERROR: specified kernel image does not exist: `/boot/vmlinuz-linux'
==> Building image from preset: /etc/mkinitcpio.d/linux/preset: 'fallback'
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
==> ERROR: specified kernel image does not exist: `/boot/vmlinuz-linux`
The script located in /mnt/root/etc can't find the "temporary kernel" located at /mnt/boot.
Last edited by xtian (2013-09-17 22:01:35)

And read them carefully, there should be no /mnt/root/etc/.
There should be a /mnt/etc/ and a /mnt/boot and /mnt/root/ which is the root user's home directory, not the root filesystem (and of course /mnt/usr ...) - or if you decide to nest the whole thing deeper you could have /mnt/somename/etc and /mnt/somename/boot ...

Similar Messages

  • How to get the script of a table or view in SQL Developer?

    Dear friends/expert,
    Could you tell me how to get the script for a view or a table easily in SQL Developer like pressing F4 in TOAD?
    I found that I can press SHIFT+F4 for a view in SQL Developer and get the script of the view in Details Tab. But how to move the script to SQL worksheet to edit? It is very easy to do in TOAD.
    And I didn't find a way to get the script for a table till now. Is there any way to do that?
    Thanks in advance.
    Best regards,
    Ning

    1. Although the team might put a lot of effort in keeping track on the forum, a lot of posts still go by without answer.
    2. If you have an enhancement request, log it at the announced SQL Developer Exchange, so others can vote to add weight on the issue. Be clear and detailed in the explanation.
    3. Given the structure of the application, I guess it won't be easy (maybe impossible) to add the functionality you are asking. Do you have a suggestion on how to access the info?
    4. If your request gets accepted, still another year or two may go by until the functionality gets added. For sure you'll be better off writing a user defined extension or report (querying DBMS_METADATA.GET_DDL).
    Hope that helps,
    K.
    Edited by: -K- on 12/01/2009 09:37

  • How to get the script pathname?

    I got the filename of javascript and pathname of javascript(not the active document file name) using the below javascript code in illustrator cs3.
    var path = $.fileName;
    But my problem was if i run the javascript through "extendscript toolkit" i got it correctly. But if i run my script through illustrator cs3 application(File->Scripts->test.jsx) i got some integer value only(did not get the javascript filepath and filename). Kindly advice how to get the javascript file name and file path in windows platform through illustrator cs3 javascript. Please help me.

    1. Although the team might put a lot of effort in keeping track on the forum, a lot of posts still go by without answer.
    2. If you have an enhancement request, log it at the announced SQL Developer Exchange, so others can vote to add weight on the issue. Be clear and detailed in the explanation.
    3. Given the structure of the application, I guess it won't be easy (maybe impossible) to add the functionality you are asking. Do you have a suggestion on how to access the info?
    4. If your request gets accepted, still another year or two may go by until the functionality gets added. For sure you'll be better off writing a user defined extension or report (querying DBMS_METADATA.GET_DDL).
    Hope that helps,
    K.
    Edited by: -K- on 12/01/2009 09:37

  • How to get this script to work with different browser

    Do you guys know how to get this script to work with mozilla firefox? 
    do shell script "open -a safari 'https://login.binck.nl/klanten/Login.aspx?ReturnUrl=%2fklanten%2fdefault.aspx'"
    tell application "Safari"
      activate
              tell document 1
                        repeat until ((do JavaScript "location.host") is "login.binck.nl")
                                  delay 1
                        end repeat
      do JavaScript"document.getElementById('ctl00_Content_Gebruikersnaam').value='sim';document.ge tElementById('ctl00_Content_Wachtwoord').value='password';window.open(document. g etElementById('ctl00_Content_LoginButton').href, '_self', 'true');"
              end tell
    end tell
    Thank you so much in advance:)

    That isn't possible. Firefox's AppleScript dictionary doesn't contain anything which can be used to manage JavaScripts.
    (63741)

  • How to run bash script using Calendar

    Hi folks.
    How can I run a bash script using Calendar?  I thought I had to park it in an AppleScript script which I could call, but that isn't really working.
    Any suggestions appreciated.
    Cheers

    Hi there.  Thanks for the reply.
    Some notes for the replies:
    - The shell script has no environment issues.  It's a straight mysqldump for a single database.
    - The AppleScript has the do shell script "path/to/script.sh" user name "root" password "wobblyhead" with administrator privileges
    - Calendar application can only recognize the .scptd and .scpt files, and not .app files.  Upon choosing my original .scpt file with the do shell script instruction, it just opens the file in AppleScript Editor. 
    So the file gets called, but for some reason, it just opens the file and won't run the file.  No options for choosing a format where it's actually run. 
    Not sure how to go about this. 
    Cheers

  • ???? how to launch bash script in cron ????

    with help from people in this forum, I successfully debugged the syntax in a shell script I wrote (my syntactical faux pas had to do with sending a multi-line mail message from a bash script).
    I can manually launch my script from Terminal's command line, and it works perfectly (well, at least it does exactly what I told it to do:). I try to launch it via cron, and it doesn't appear to ever launch.
    In /var/cron/tabs/root, the pertinent line of text reads:
    00 22 * * * /usr/local/customShellScripts/script.sh
    so it is supposed to launch daily at 10PM.
    Other jobs listed in /var/cron/tabs/root do run, because I get emails to my postfix admin account saying that they do. However, none of those other jobs are shell scripts; they are stuff like:
    24 06 * * 5 /usr/sbin/diskutil verifyVolume /
    The directory listing for /var/cron/tabs/root reads:
    $ ls /var/cron/tabs
    total 4
    drwxr-xr-x 3 root wheel 102 Mar 25 18:53:28 2006 .
    drwxr-xr-x 3 root wheel 102 Mar 20 17:13:47 2005 ..
    -rw-r--r-- 1 root wheel 1040 Mar 31 20:28:10 2006 root
    The directory listing for script.sh reads:
    $ ls /usr/local/customShellScripts/
    total 24
    drwxr-xr-x 6 root wheel 204 Mar 31 18:31:27 2006 .
    drwxr-xr-x 11 root wheel 374 Mar 5 12:26:23 2006 ..
    -rw-r--r-- 1 root wheel 6148 Feb 4 14:13:22 2006 .DS_Store
    -rwxr-xr-x 1 root wheel 8058 Mar 31 20:27:50 2006 script.sh
    for debug, the first two lines of script.sh read:
    #!/bin/sh
    /usr/bin/touch /foo
    but the file /foo never gets created. I tried using just "touch /foo" and that didn't work either.
    Also, since the script has a lot of calls to "echo," "expr," "date," "cut," "awk," etc., if I ever get cron to execute the script past the shebang line, do I have to preface all those calls with their full path? Or can I do something like in the old /etc/crontab file, where they defined a path variable up front
    PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
    and the script will be smart enough to look in those directories for the appropriate executables?
    But, getting back to the first problem, I am obviously overlooking something very basic, which is not surprising since I'm self-taught (and I guess, Apple Unix Discussions forum taught) at this unix thing and shell scripting. So, can anybody bail me out here...again?
    2001 Quicksilver G4   Mac OS X (10.4.5)  

    Hey Reese
    You bailed me out, dude! Apparently, my difficulties stemmed from me trying to directly edit /var/cron/tabs/root with pico. Never seemed to bother the other stuff, but it did this time. I am totally inept with vi, the default editor for crontab -e, which is why I had cheated before, and directly edited the /var/cron/tabs/root, el.al., so I had to find out how to
    export EDITOR='pico'
    in my .bashrc
    After having done that, no problem, except for a latent programming logic bug that has reared its ugly head (my script is doing some date manipulation with today's and yesterday's date, and my script crashed and burned on the month change and with stuff related to single-digit date sequence numbers <10).
    But, hey, I learned how to reset my default editor, so as to make life easier for me when it comes time to dorking with crontab files, and I learned that when the crontab file says "DO NOT EDIT THIS FILE - edit the master and reinstall," it means it!
    Thanx for the troubleshooting hint.

  • [SOLVED] XMMS2 media hotkeys, bash scripts

    Hi!
    For the really beginners of the XMMS2 users as me, should be a nice something like a guide/tutorial.
    Here is the bash scripts that might enchant functionality and be more useful for use of the media keys.
    For randomizing before any other action you can use even something like:
    xmms2 playlist shuffle ; xmms2 jump 1; xmms2 play
    # Just for dummies
    The Preview hotkey loop.
    From the begin of the playlist to the end of it when current is the first one being played:
    #!/bin/bash
    #Play the previews or first if end of the playlist
    if [ "XX"$(xmms2 prev | awk '{print $1}') == "XXServer" ] ; then
    if [ "XX"$(xmms2 jump $(xmms2 list | grep -i '/' |wc -l) | awk '{print $1}') == "XXServer" ] ; then
    xmms2 playlist list;
    echo The playlist is empty, please choose one from of the above ;
    echo or add a new songs to the playlist with a '"xmms2 add"';
    fi; fi;
    #It takes time to count to the last song in the playlist, longer it is more time it takes :(. I haven't found a better way yet.
    The Next hotkey loop.
    When the end of the playlist is reached then goto jumping to the first one song in the playlist:
    #!/bin/bash
    #Play the first song if in the end of the playlist
    if [ "XX"$(xmms2 next | awk '{print $1}') == "XXServer" ] ; then
    if [ "XX"$(xmms2 jump 1 | awk '{print $1}') == "XXServer" ] ; then
    xmms2 playlist list;
    echo The playlist is empty, please choose one from of the above ;
    echo or add a new songs to the playlist with a '"xmms2 add"';
    fi; fi;
    For the Play/Pause key:
    #!/bin/bash
    #For the single Play/Pause key
    GetStatus=$(xmms2 current | awk -F":" '{print $1}')
    #Any command line parameters to the script for randomizing of the playslist.
    if [ "S" != "S"$1 ] ; then
    xmms2 playlist shuffle
    fi;
    if [ "$GetStatus" == "Playing" ]; then xmms2 pause;fi
    if [ "$GetStatus" == "Paused" ]; then xmms2 play;fi
    if [ "$GetStatus" == "Stopped" ]; then
    xmms2 play
    GetStatus=$(xmms2 current | awk -F":" '{print $1}')
    if [ "$GetStatus" == "Stopped" ]; then
    xmms2 playlist list;
    echo The playlist is empty, please choose one from of the above ;
    echo or add a new songs to the playlist with a '"xmms2 add"';
    fi
    fi
    or you can use even xmms2 toggle command line for the play/pause hotkey.
    Turn On/Off repeat/loop of the playlist:
    #!/bin/bash
    GetStatus=$(xmms2 server config playlist.repeat_all )
    case $GetStatus in
    "playlist.repeat_all = 1") xmms2 server config playlist.repeat_all 0 ; sudo beep; echo is OFF ;;
    "playlist.repeat_all = 0") xmms2 server config playlist.repeat_all 1 ; sudo beep ; sudo beep ; echo is ON;;
    esac
    You can install beep but the beep has a problem, you can run it only as a root but a more danger way is to by pass this by adding the beep into /etc/sudoers , e.g. yourusername ALL=NOPASSWD: /usr/sbin/beep.  Be careful! It may expose your system for unwanted access to and do a harm. The best way is to find a better way for notification of changes.
    If someone has another script solutions for the multimedia hotkeys or media fun for XMMS2 then please share with us!
    Automation is power of the shell
    Notice
    The hotkey names of my Digital Media Keyboard 3000, but I think that it becomes more as a standard, it is just to get a faster access to the names.
    XF86AudioPlay, XF86AudioNext, XF86AudioPrev,XF86AudioStop
    XF86AudioMute (amixer -c 0 set Master toggle), *, (pactl set-sink-mute 0 toggle)
    XF86AudioRaiseVolume (amixer -c 0 set Master 3+), xmms2 server volume +3, (pactl set-sink-volume 0 +3%)
    XF86AudioLowerVolume (amixer -c 0 set Master 3-). xmms2 server volume -3, (pactl set-sink-volume 0 -- -3%)
    amixer = ALSA
    pactl = PulseAudio (0 is index of the sinks, you can see which you can use with pacmd list-sinks, marked with * is default)
    The other way to increase and decrease volumes is here.
    Change between ALSA and PulseAudio sound servers for XMMS2
    nyxmms2 server config output.plugin pulse
    nyxmms2 server config output.plugin alsa
    Otherwise you can use xev to retrieve the names of the supported keys by X server, as I know X server has a limitations to the 255 key numbers/keycodes. One more but less useful for GUI is showkey, just to know that it is also and always exists, with a great manual about the kbd keys.
    * To mute/unmute XMMS2 you can use xmms2 server volume 0 / xmms2 server volume 100 or for more advanced e.g. xmms2 server volume -c left 100/xmms2 server volume -c right 100 and combine with any keys you wish the way is best for you. I haven't found any way to make anything to remember status after mute/unmute of xmms2. Alias for the mute only is xmms2 mute. If you will find it before me please help .
    Here is one more guide for the BlackBox menu. I could not get xmms2 mlib loadall to work in Arch.
    In Arch you must use xmms2 playlist sort instead of xmms2 sort because it doesn't work otherwise.
    xmms2 playlist sort album
    xmms2 playlist sort title
    xmms2 playlist sort artis
    Last edited by Andy_Crowd (2014-10-18 11:34:45)

    Zariel wrote:
    i guess something like this?
    %optical ALL=(ALL) NOPASSWD: ALL
    I found the clues for this in the sudoers manual:
    handy   ALL = NOPASSWD: /sbin/umount /CDROM,\
                    /sbin/mount -o nosuid\,nodev /dev/cd0a /CDROM
    Which works in so far as now mounting no longer needs the password.
    Which leaves me with the problem of trying to understand how to get Worker to mount the optical drive on command.
    If I enter the bash command in the Terminal as follows:
    mount /mnt/dvd
    the media is mounted, after which I can push the button in Worker, which I have configured with:
    /mnt/dvd
    & the root list of the optical media is displayed in the active panel of Worker.
    I just haven't been able to get Worker to use "mount /mnt/dvd" yet, there will be a way, I wonder how long it will take me to find it? lol
    Last edited by handy (2008-11-19 06:48:09)

  • How to get DDL Script in Oracle 11g

    How can i get DDL Script in Oracle 11g database.
    I am using windows as OS
    Can anyone help me to get solution.
    Thanks in Advance

    parapr wrote:
    How can i get DDL Script in Oracle 11g database.
    I am using windows as OS
    Can anyone help me to get solution.
    Thanks in AdvanceHUH?
    might DBMS_METADATA.GET_DDL() provide what you desire?

  • [SOLVED]How to get colorful output when pipe yaourt's STDIO to less?

    Hello, second post to NC.
    My question is how to get a piped(e.g. pipe yaourt's STDOUT to less) program's colorful output on screen without such option like '--color=always'.
    Before post this, I've configured less's default behaviour in "~/.zshrc" with following
    less() {
    env LESS=R less "$@"
    And When I run:
    $ dmesg --color=always | less
    Everything works fine(I get good, colorful output), but when I run this:
    $ yaourt -Qe --date | less
    Seems that I can only get grey output on terminal emulator (without 'less' I get colorful output).
    Does anyone has idea about getting yaourt's colorful output with 'less' ?
    Last edited by izmntuk (2014-06-08 00:15:15)

    Thanks for reply and after serveral mintues googling & getting some help from IRC:
    It seems that there're some utilities that do not provide such a option like 'color=always', what we need to do is trick these utilities into thinking their's STDIO is to a tty, not a pipe.
    1. stdoutisatty way (aur/stdoutisatty-git is needed) from [0]:
    $ stdoutisatty yaourt -Qe --date | less
    2. socat way (extra/socat is needed, sometimes doesn't work fine) from [1]:
    $ socat EXEC:"yaourt -Qe --date",pty STDIO | less
    3. script way (sometimes doesn't work fine) from [2]:
    $ script -fqc 'yaourt -Qe --date' | less
    4. unbuffer way (extra/expect is needed) from [3]:
    $ unbuffer yaourt -Qe --date | less
    5. zpty way (extra/zsh is needed) slightly modified from [4]:
    zmodload zsh/zpty
    autoload colors && colors
    pty() {
    local VERSION=0.2
    if [[ -t 0 && $# -ne 0 && ${1} != '--help' ]];then
    zpty pty-${UID} ${1+"$@"}
    ## when piping function pty to a pager, it may be a good idea to disable ^C *in this function*. assume that you're going to run this command: pty ls -alRi --color | less
    ## and now you enter a pager, and you press the End key by accident, and the pager seems stuck, and to get unstuck you pressed ^C, then the entire function interrupted. so to avoid the interrupt:
    if [[ ! -t 1 ]];then
    setopt local_traps
    trap '' INT
    zpty -r pty-${UID}
    else
    zpty -r pty-${UID}
    fi
    zpty -d pty-${UID}
    elif [[ $# -eq 1 && ${1} == '--version' ]];then
    print "pty v${VERSION}"
    else
    _-automatic-colored
    print "${bldblu}Usage: ${bldgrn}pty${rst} ${bldcyn}command${rst} [${bldcyn}argv${rst}...]
    wrapper function to run a program under pseudo-terminal
    ${bldcyn}--help${rst} print help message
    ${bldcyn}--version${rst} print version"
    fi
    ptypg() {
    if [[ -t 0 && $# -ne 0 && ${1} != '--help' ]];then
    pty $@ | pg
    else
    _-automatic-colored
    print "${bldblu}Usage: ${bldgrn}ptypg${rst} ${bldcyn}command${rst} [${bldcyn}argv${rst}...]
    wrapper function to run a program under pseudo-terminal and view its output in pg
    ${bldcyn}--help${rst} print help message"
    fi
    _-automatic-colored() {
    if [[ "${1}" == unset || ! -t 1 ]];then
    unset rst bld bldwht bldblk bldred bldgrn bldylw bldblu bldcyn blk red grn ylw blu cyn gry
    return 0
    elif [[ -t 1 ]];then
    rst="${reset_color}"
    bld="${fg_bold[default]}"
    bldwht="${fg_bold[white]}"
    bldblk="$fg_bold[black]"
    bldred="$fg_bold[red]"
    bldgrn="$fg_bold[green]"
    bldylw="$fg_bold[yellow]"
    bldblu="$fg_bold[blue]"
    bldcyn="$fg_bold[cyan]"
    gry="${fg[white]}"
    blk="$fg[black]"
    red="$fg[red]"
    grn="$fg[green]"
    ylw="$fg[yellow]"
    blu="$fg[blue]"
    cyn="$fg[cyan]"
    return 0
    fi
    $ pty yaourt -Qe --date | less
    $ ptypg yaourt -Qe --date
    And if there are any better implementation please leave a comment add it to wiki .
    Last edited by izmntuk (2014-08-19 14:18:45)

  • [solved] Segmentation fault with bash script

    I have a bash script that checks if it has to do something, if not it sleeps 15 secs and checks again. It works great except that after ~6hrs of just checking and sleeping it seg faults. I upped the stack limit with ulimit -s and it goes ~12hrs before it seg faults. I have a similar script that I have been using for ages that works for 24hrs no problem and I can't pinpoint where the problem is.
    The check it does is to see if a file exists, if it's empty and if not, read the first line of a file and do some date comparisons. It doesn't matter if the file is empty or not the seg fault always happens.
    Here's the seg fault causing script - it starts at the bottom
    #!/bin/bash
    # User defines
    declare -i DVB_DEVICE_NUM="0"
    declare CHANNELS_CONF="${HOME}/Mychannels.conf"
    declare SAVE_FOLDER="${HOME}/TV/tele"
    declare SCHED_FILE="$HOME/.sched-tv"
    declare ZAP_COMMAND="tzap"
    declare -i SLEEP=15
    # Program defines
    declare -i DAY="0"
    declare -i START="0"
    declare -i FINISH="0"
    declare CHAN="0"
    declare NAME="0"
    declare -i MINUTES="0"
    declare -i REC_START="0"
    declare -i REC_HOURS="0"
    declare -i REC_MINS="0"
    declare -i howlong="0"
    declare -i PIDOF_AZAP=0
    declare -i PIDOF_CAT=0
    red='\033[1;31m'
    green='\033[1;32m'
    yell='\033[1;33m'
    cyan='\033[1;36m'
    white='\033[1;37m'
    reset='\033[0m'
    function remove_entry {
    if [ "$NAME" == "" ]; then
    sed "/$DAY $START $FINISH $CHAN/d" $SCHED_FILE > /tmp/dummy
    else
    sed "/$DAY $START $FINISH $CHAN $NAME/d" $SCHED_FILE > /tmp/dummy
    fi
    mv /tmp/dummy $SCHED_FILE
    function record_entry {
    ${ZAP_COMMAND} -a ${DVB_DEVICE_NUM} -f ${DVB_DEVICE_NUM} -d ${DVB_DEVICE_NUM} \
    -c $CHANNELS_CONF -r ${CHAN} >/dev/null 2>&1 &
    PIDOF_AZAP=$!
    if [ "$PIDOF_AZAP" == "" ]; then
    printf "$red\tError starting ${ZAP_COMMAND}.\n\tFAILED: $CHAN $START\n"
    remove_entry
    exit 1
    fi
    printf "$green\tSET CHANNEL$cyan ${CHAN}\n"
    REC_MINS=$((${START}%100))
    REC_HOURS=0
    MINUTES=0
    REC_START=$(($START-$REC_MINS))
    while [ $((${REC_START}+${REC_HOURS}+${REC_MINS})) -lt $FINISH ]; do
    ((REC_MINS++))
    ((MINUTES++))
    if [ ${REC_MINS} -ge 60 ]; then
    REC_MINS=0
    ((REC_HOURS+=100))
    fi
    done
    if [ "$NAME" == "" ]; then
    declare FILE_NAME="${SAVE_FOLDER}/TV-`date +%Y%m%d-%H%M`-ch.${CHAN}-${MINUTES}.min.mpg"
    else
    declare FILE_NAME="${SAVE_FOLDER}/TV-${NAME}-${MINUTES}.min.mpg"
    fi
    dd if=/dev/dvb/adapter${DVB_DEVICE_NUM}/dvr${DVB_DEVICE_NUM} \
    of=${FILE_NAME} conv=noerror &
    PIDOF_CAT=$!
    if (( ${PIDOF_CAT} == 0 )); then
    printf "$red\tError Starting Recording.\n\t/dev/dvb/adapter${DVB_DEVICE_NUM}/dvr${DVB_DEVICE_NUM} Unavailable\n"
    kill ${PIDOF_AZAP}
    remove_entry
    exit 1
    fi
    printf "$yell\tRECORDING TO :$cyan ${FILE_NAME}\n"
    sleep ${MINUTES}m
    kill ${PIDOF_CAT} && wait ${PIDOF_CAT} 2> /dev/null
    # pkill $ZAP_COMMAND # && wait ${PIDOF_AZAP} 2> /dev/null
    kill ${PIDOF_AZAP} && wait ${PIDOF_AZAP} 2> /dev/null
    printf "$yell\tFINISHED REC :$cyan ${FILE_NAME}\n$reset"
    remove_entry
    waiting 1
    function check_action {
    [ -e "$SCHED_FILE" ] || waiting $SLEEP
    [ "`cat $SCHED_FILE`" == "" ] && waiting $SLEEP
    DAY="0"; START="0"; FINISH="0"; CHAN="0"; NAME="0"
    TODAY=`date +%Y%m%d`
    NOW=`date +%k%M`
    while read -r DAY START FINISH CHAN NAME; do
    #printf "$DAY $START $FINISH $CHAN $NAME\n"
    break
    done < $SCHED_FILE
    if [ $DAY == $TODAY ] && [ $START -lt $NOW ]; then
    printf "$red\tOld Entry : Removing $CHAN $START\n"
    remove_entry
    waiting 1
    fi
    if [ $DAY == $TODAY ] && [ $START == $NOW ]; then
    record_entry
    else
    waiting $SLEEP
    fi
    function waiting {
    howlong=$1
    sleep $howlong && check_action
    check_action
    exit 0
    And the script that has been working fine 24hrs at a time
    #!/bin/bash
    echo alarm uses a twelve hour clock
    echo Type the time for the alarm to sound as 00-00-?m
    echo e.g. 05-35-pm for 5:35pm :: 05-35-am for 5:35am
    read TIME
    function play {
    A="$(date +%I-%M-%P)"
    if [ $A = $TIME ]; then
    for i in {1..10}; do
    $(aplay -c 1 /home/$USER/alarm/chime.wav); done
    exit
    else
    wait
    fi
    function wait {
    sleep 15 && play
    play
    I was hoping to have this script idling away in screen with rtorrent, always ready to do something if need be but that's not going to happen unless I can get a clue on what part of the script I need to change to not hit any limits. My websearches are failing me on this...
    Last edited by moetunes (2012-06-24 21:41:52)

    Thanks falconindy. I changed to using a while loop.
    #!/bin/bash
    set -o nounset
    shopt -s huponexit
    # User defines
    declare -i DVB_DEVICE_NUM="0"
    declare CHANNELS_CONF="${HOME}/Mychannels.conf"
    declare SAVE_FOLDER="${HOME}/TV/tele"
    declare SCHED_FILE="$HOME/.sched-tv"
    declare ZAP_COMMAND="tzap"
    declare -i SLEEP=15
    # Program defines
    declare -i DAY="0"
    declare -i START="0"
    declare -i FINISH="0"
    declare CHAN="0"
    declare NAME="0"
    declare -i MINUTES="0"
    declare -i REC_START="0"
    declare -i REC_HOURS="0"
    declare -i REC_MINS="0"
    declare -i howlong=$SLEEP
    declare -i PIDOF_AZAP=0
    declare -i PIDOF_CAT=0
    red='\033[1;31m'
    green='\033[1;32m'
    yell='\033[1;33m'
    cyan='\033[1;36m'
    white='\033[1;37m'
    reset='\033[0m'
    function remove_entry {
    if [ "$NAME" == "" ]; then
    sed "/$DAY $START $FINISH $CHAN/d" $SCHED_FILE > /tmp/dummy
    else
    sed "/$DAY $START $FINISH $CHAN $NAME/d" $SCHED_FILE > /tmp/dummy
    fi
    mv /tmp/dummy $SCHED_FILE
    function record_entry {
    ${ZAP_COMMAND} -a ${DVB_DEVICE_NUM} -f ${DVB_DEVICE_NUM} -d ${DVB_DEVICE_NUM} \
    -c $CHANNELS_CONF -r ${CHAN} >/dev/null 2>&1 &
    PIDOF_AZAP=$!
    if [ "$PIDOF_AZAP" == "" ]; then
    printf "$red\tError starting ${ZAP_COMMAND}.\n\tFAILED: $CHAN $START\n"
    remove_entry
    exit 1
    fi
    printf "$green\tSET CHANNEL$cyan ${CHAN}\n"
    REC_MINS=$((${START}%100))
    REC_HOURS=0
    MINUTES=0
    REC_START=$(($START-$REC_MINS))
    while [ $((${REC_START}+${REC_HOURS}+${REC_MINS})) -lt $FINISH ]; do
    ((REC_MINS++))
    ((MINUTES++))
    if [ ${REC_MINS} -ge 60 ]; then
    REC_MINS=0
    ((REC_HOURS+=100))
    fi
    done
    if [ "$NAME" == "" ]; then
    declare FILE_NAME="${SAVE_FOLDER}/TV-`date +%Y%m%d-%H%M`-ch.${CHAN}-${MINUTES}.min.mpg"
    else
    declare FILE_NAME="${SAVE_FOLDER}/TV-${NAME}-${MINUTES}.min.mpg"
    fi
    dd if=/dev/dvb/adapter${DVB_DEVICE_NUM}/dvr${DVB_DEVICE_NUM} \
    of=${FILE_NAME} conv=noerror &
    PIDOF_CAT=$!
    if (( ${PIDOF_CAT} == 0 )); then
    printf "$red\tError Starting Recording.\n\t/dev/dvb/adapter${DVB_DEVICE_NUM}/dvr${DVB_DEVICE_NUM} Unavailable\n"
    kill ${PIDOF_AZAP}
    remove_entry
    exit 1
    fi
    printf "$yell\tRECORDING TO :$cyan ${FILE_NAME}\n"
    sleep ${MINUTES}m
    kill ${PIDOF_CAT} && wait ${PIDOF_CAT} 2> /dev/null
    # pkill $ZAP_COMMAND # && wait ${PIDOF_AZAP} 2> /dev/null
    kill ${PIDOF_AZAP} && wait ${PIDOF_AZAP} 2> /dev/null
    printf "$yell\tFINISHED REC :$cyan ${FILE_NAME}\n$reset"
    remove_entry
    while true; do
    sleep $howlong
    howlong=$SLEEP
    [ -e "$SCHED_FILE" ] || continue
    [ "`cat $SCHED_FILE`" == "" ] && continue
    TODAY=`date +%Y%m%d`
    NOW=`date +%k%M`
    while read -r DAY START FINISH CHAN NAME; do
    #printf "$DAY $START $FINISH $CHAN $NAME\n"
    break
    done < $SCHED_FILE
    if [ $DAY == $TODAY ] && [ $START -lt $NOW ]; then
    printf "$red\tOld Entry : Removing $CHAN $START\n"
    remove_entry
    howlong=1
    continue
    fi
    if [ $DAY == $TODAY ] && [ $START == $NOW ]; then
    record_entry
    fi
    done
    exit 0
    I think that should be ok now.

  • [SOLVED]How to get a kicker panel like this?

    I want my Arch/Chakra KDE to have a transparent kicker panel like http://pclinuxos.com/wp-content/uploads … minime.png I tried various permutation and combinations of existing themes i.e Air, Air Netbooks, Oxygen. Tried few themes like Glaze etc but none of them work. I don't want a complete transparent panel like in Bare Naked Theme(which does not work/come in KDE 4.4.2 BTW) but like shown in the above image with slight white hue but not more. Perfect as in the image. Does anyone know how to get it?
    Last edited by chakra-user (2010-04-23 06:14:28)

    toxygen wrote:
    look for the naked plasma theme, or the bare naked theme (this is for kde 4.x).  you can do it through settings ->aapearance -> style -> workspace and change the theme there (or get new theme and search for naked).
    or you can go to http://kde-look.org and search there for plasma theme
    Like I mentioned above, * Naked theme is not available for 4.4.2 becoz I could not download it via the built in kde theme manager maybe it is in compatible. Is there a way to remove those ugly round shapes from AIR theme. modify .svg of air how?

  • How to get my Drobo FS to mount in Mountain Lion Server.app

    Hello Everyone,
    Thanks in advance for the help. I am struggling with getting my drobo fs connected to my AE to show up in the server.app. I want to use my drobo fs as a mass storage device for the server since the server has a small hard drive. But I cannot seem to figure out how to get it to show up when I try to start the time machine service or include a folder on the drobo in the file sharing service. Does the server.app recognize or see network drives? The drobo connects as a server to the ML server, do I need to install drobo dashboard to get the server to see it as something else? I tried to create a share with the time machine option to see if it would mount as a local drive but it only mounts as a local. I think I'm on the right track, server.app only sees local drives but is there a way to get it to see my network drobo fs? Also, can I connect the drobo to the server (forgive me if this seems confusing), my mac mini via a thunderbolt to ethernet adapter? Would a direct connect change the way the mini mounts the drobo thus enabiling server.app to see the drive as local?
    Thanks again for the help....
    Also, when the drobo is connected to the AE it is assigned an ip 10.0.1.2, I connected it to my mac mini and the mac mini to my AE via wifi and the server.app had a fit because the ip addresses changed. I was unable to get the drobo to mount. I could reset the drobo as I do not have that much information on it. I could backup the drobo and restart anew which, I think, would allow the mac mini to create an ip for the drobo.

    I guess in another forum that I posted this the question is not clear.
    I want the drobo which is basically a NAS to show up when I try to implement the time machine service in the server.app. I have the drobo mounted and all is working fine but when I try to implement time machine in server it only shows me my internal (local) drive and not the drobo. I am wondering if it is due to the drobo connecting to the mac as a server itself (ip address assigned). Would an adapter help me with this? Such as a thunderbolt to ethernet adapter or ethernet to USB 3.0? would that create another ethernet connection on the mac or could I get the mac to see that connection as it is a USB or thunderbolt connected drive?

  • [solved] How to run a script on logout?

    I've just migrated from ubuntu and so far I'm really happy with Arch. GNU/Linux really is easier to 'get' with Arch. I've been able to overcome all problems so far with reading previous posts or searching for it by other means, yet this obviously elementary broblem still defies solution.
    - How do I run a script on logout?
    What I want to do on logout is to run 'fusermount -u ~/mounted-dir/', where 'mounted-dir' holds media from my account on another host. I have it set up so that /etc/profile runs ~/.login which in turn runs 'sshfs [email protected]:~/media/ ~/mounted-dir/ -o sshfs_sync -o reconnect'.
    - Is this a reasonable way of Getting Things Done?
    I suspect (as I always do) that there might be a way these things are supposed to be done, this not being it.
    Last edited by pooflinger (2007-10-05 10:05:29)

    pooflinger wrote:
    _adam_ wrote:
    the problem with .bash_logout is it will run whenever you exit a bash instance.
    are you using a desktop environment? do you just want this to happen prior to shutdown? or when you actually log out?
    I pretty sure that .bash_logout only runs if $SHELL is /bin/bash when you log out. I want this to happen when I actually log out.
    yeah, sorry, i forgot its only executed when a login shell is used.

  • How to get DW-CS3 to recognize .phtml file?

    I work with PHP files in DW-CS3 that have the filename extension .phtml.  When I load these files into DW, I can only view the code, not the split view or design view.  But I am able to see these views if I rename the file extension .php, so there must be a way to get it to recognize the .phtml extension.  Anyone know how I can do this?  Thanks.

    Follow the instructions in this technote: http://www.adobe.com/go/tn_16410.

  • How to get stop script for the server

    Hello everyone,
    I installed weblogic server8.1 on my Linux machine and used $WL_HOME/server/bin/startWLS.sh
    to create a new domain and server. But I did not find any stop script(like stopWLS.sh)
    which can stop myserver. How can I get it?
    Thanks for your helps.
    Iris

    which can stop myserver. How can I get it?Here's an etc/rc3.d script I use for my RH9 server. You'll notice there is
    a line in there for stop(), you can run that manually if you so choose, or
    you can use it via the xinetd (I think that's what it's called?). Good luck.
    # processname: weblogic
    # pidfile: /var/run/weblogic.pid
    PIDFILE=/var/run/weblogic.pid
    # Source function library
    . /etc/init.d/functions
    #check to see if we can write to config.xml...so non-root uses stop here
    [ -w /Domain/config.xml ] || exit 0
    #setup the environment for the java commands
    . /bea/weblogic81/server/bin/setWLSEnv.sh
    cd /Domain
    start(){
    echo "Starting WebLogic for Domain"
    cd /Domain
    daemon ./startWebLogic.sh &
    echo $! > $PIDFILE
    RETVAL=$?
    echo "WebLogic Server started."
    return $RETVAL
    stop(){
    echo "Stopping WebLogic for Domain"
    rm -f $PIDFILE
    java weblogic.Admin -url localhost:80 FORCESHUTDOWN
    status(){
    echo "Getting Weblogic status for Domain"
    java weblogic.Admin -url localhost:80 GETSTATE
    restart(){
    echo -n "Restarting WebLogic for Domain"
    stop
    start
    # See how we were called.
    case "$1" in
    start)
    start
    stop)
    stop
    restart|reload)
    stop
    start
    status)
    status
    echo $"usage: $0 {start|stop|status|restart|reload}"
    exit 1
    esac
    exit $RETVAL

Maybe you are looking for

  • What is the use of OTYPE_REF in Add method

    what is the use of OTYPE_REF in Add method

  • How to create custom reports.

    Hi , Could you please let us know how to create custom reports which are data based and not analytics. Which is the best method , is it to devlop reports in sites or integrate with OBIEE reports. could you please let us know the best practices for th

  • Eclipse newbie question

    I just installed eclipse with openjdk6. When I try to run something, even the most basic hello world thing, I get this: Exception in thread "main" java.lang.NoClassDefFoundError: Caused by: java.lang.ClassNotFoundException: at java.net.URLClassLoader

  • How to find that how many times listener is restarted using listener.log

    How to find that how many times listener is restarted using listener.log

  • Getting the error while FM

    getting this error in ENTER RATE/USD rate type Mfor date in the system settings. this error after execution of fumction module "CONVERT_TO_FOREIGN_CURRENCY" what can be the problem..