Ubuntu :: Write A Bash Script That Will Check If XMBC Is Running If It Is Then Do Nothing Else Start It Then Do Some Other Things?

Jul 23, 2011

<edit>never mind dump the ;'s and it all works fine</edit> I'm trying to write a bash script that will check if XMBC is running if it is then do nothing else start it then do some other things.This is the start

Code:
#!/bin/bash
DISPLAY=:0.0

[code]....

View 2 Replies


ADVERTISEMENT

General :: Bash Script - Check Process Is Running, If Not Start?

Feb 7, 2010

I am using Sphinx search on my webserver and it quits after a certain amount of time leaving my search page broken.Here is a bash script that I want to run every 10mins via cron:

Code:
#!/bin/bash
if pgrep searchd | grep "[0-9]"

[code]...

View 24 Replies View Related

General :: Running A Check In Bash Script?

Apr 3, 2011

so I wrote a small script that pretty much just takes in two numbers and counts from the first to the second, e.g.

unknown-hacker|544> count.sh 1 3
1
2
3

My problem is I want to make it so that if you input invalid parameters, such as non-numerical characters, more than 2 numbers, etc., you'd get an error message

View 15 Replies View Related

General :: Check Which Version Of Bash I'm Running ?

Aug 16, 2010

How can I check which version of bash I'm running

View 2 Replies View Related

General :: Can Bash Check If Screensaver Is Running

Nov 13, 2010

I have a bash script that messages the user periodically. Is there any way in the script to check if the screensaver is running, so the script doesn't spam messages while the user is away? The xscreensaver process is always running in the background, I've noticed.

View 5 Replies View Related

Programming :: BASH - Can't Check If XScreenSaver Is Running

Feb 26, 2011

I'm having trouble trying to make a script. What I want to do is check if xScreenSaver is running in my user account. If not, run it. If it's running, kill it.

So this is the script I've made:

Code:

The problem is that I've echoed the output of $(pgrep -u $(whoami) xscreensaver) and it always seems to add 4 numbers to the pid, even if the pid doesn't exist. What do I mean by "doesn't exist"? That no xscreensaver is running in my user, and if I run pgrep -u $(whoami) xscreensaver in bash, I get not output, but if I run the command though the script, I get (for instance) 4050. If I run it again, I get 4054, and again 4058... etc. What the hell is going on with that?

View 5 Replies View Related

General :: Bash Shell Script To Check / If Empty Files Are Being Created & Start Process

Jun 25, 2010

I have an Ubuntu server in which a file is dumped every hour and a new file for the next hour and the process continues. If there is any problem due to which the creation of file stops then empty files are created every minute till the process is killed & started again. I need help to make a shell script to check if the empty files are being created and then kill the process and start it again.It would be a great help if anyone can help me regarding this.

View 9 Replies View Related

General :: Bash - Start A Service Only If It Isn't Running?

Apr 16, 2010

I know I have to count how many instances are running: ps x | grep apache2 | wc -l result if it's running: 2, or else: 1 I also know there is a command called test that I could use to perform the verification, but I don't know how to use test with wc

View 3 Replies View Related

General :: Server 'really Slow' What First Couple Things To Check?

Aug 19, 2010

A server is described as being "really slow". What are the first couple of things you would check?

View 2 Replies View Related

Ubuntu :: Script - Start Or Stop The GUI Respectively - Write A "if The GUI Is Running Then..." Command?

Apr 25, 2011

i want to write a script that will start or stop the GUI respectively. This is what I have so far...

[Code]....

I know the second line is completely wrong, but thats where I'm trying to go. How do I write a "if the GUI is running then..." command?

View 2 Replies View Related

Ubuntu :: Customize Things Running 10.04?

May 12, 2010

I've installed Ubuntu 10.04 and I wanted to customise it a little (splash screen, login screen, window theme) - problem is, all of the tuts on the net have been written for 9.xx or lower and none of them seem to work with the version that I am running (I can't remember why right now because I looked this up a few days ago but there was a tab missing in 10.04 that was there in 9.xx and below). how to customise these things running Ubuntu 10.04?

View 9 Replies View Related

General :: Running NT In VM - How Things Work

Mar 24, 2010

How Linux would run NT in a VM, and the correct definition of how things work. Now I now about nothing about of Linux, though I have installed it a few times, but never really worked with it. I have been using MS products for 15 Plus years and have a pretty good understanding of how things work. I do not claim to be any expert. Some Idea of what I am inquiring: Now, how does the Linux Kernel handle the NT Kernel? Are processes/threads in cpu separated for each Kernel? How would interrupt requests be handled? How is Memory and Disk Management handled? Then obviously how would Device Management be handled as well?

View 3 Replies View Related

General :: Write A Literal Bash Command In A Bash File?

Nov 29, 2010

I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it.Here's my bash file:

Code:
#!/bin/bash
cat > ~/generateGridmix2data.sh << END

[code]...

View 6 Replies View Related

Ubuntu :: Running From USB Drive - Possible To Save Things - Download Programs - Drivers?

Apr 18, 2010

A few sectors on my Hard drive on my toshiba laptop are having issues, so i have to load Ubuntu (9.10 i believe) from a USB drive. Is is still possible to save things, download programs, drivers, and anything so i can still use most of ubuntu's features without everything resetting after a reboot?

View 1 Replies View Related

Ubuntu / Apple :: Machine Running Maxed Out In Order To See Where Things Can Be Improved

Sep 21, 2010

So now I've got my iMac G3 running nicely I was wondering how I go about running a burn in test so that I can see if I can improve the cooling in places by manipulating airflow, I have a thermal cam but I want the machine running maxed out in order to see where things can be improved.CPUBurn in the repos isn't coded for PPC, only x86 x86_64.

View 5 Replies View Related

General :: Running Bash But Common Bash Commands Not Working?

Jul 17, 2010

below are the details of my system. I have bash as my current shell, some really common commands aren't working.

Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of [URL])

Code:
root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$

[Code]....

View 13 Replies View Related

Ubuntu Networking :: UPnP / Port Forwarding - XMBC And UTorrent

Sep 15, 2010

I've recently moved my media center pc from windows 7 to Ubuntu, now while on windows 7. I used the machine with XBMC and utorrent with upnp enabled on my router (Netgear WNR2000 v1) and also in the utorrent client for the port mapping. I was also able to connect to the machine from work via remote desktop (via Windows RDP, real/ultra vnc) using either a windows machine or via ubuntu that I have installed on a laptop (externally to my network). Utorrent also was able to talk to my router and ask for the ports it needed via uPnp or even by setting the port forwarding manually.

Since upgrading ( ) to Ubuntu from windows 7 on my mediacenter pc I've not been able to connect via RDP / VNC using port forwarding from the outside world although I added ports 5900 and (i beleive) 3389 to the port forwarding section in my router and pointing it to the static ip on my mediacenter. I'm also not able to get the ports to forward for deluge / vuze at all, if i manaually set port forwarding up then nothing happens and deluge says it has no incoming connections and it also doesn't talk to my router to ask for ports via upnp.

The same also holds true for the linux version of sopcast which will not connect to any streams. I can also replicate the same issue on a laptop that I use with ubuntu installed. If I watch my upnp page on my router config then I can see that my windows clients (Brother & Mom's macine) both talk to the router and ask it for ports so I assume that the router is working as it should be but obviously the fault happens when my ubuntu )10.04.1) clients ask for any kind of ports. By default is there any kind of firewall installed on ubuntu or anything I need to do to allow it to ask for upnp connections?

View 1 Replies View Related

Programming :: Name Of Formula N Things Out Of Collection Of M Things

Jul 22, 2011

I'm working through some problems in a beginners programming book. The author mentions a formula for calculating the number of ways of picking out n things from a collection of m of them:

Code:
/ m m!
| | = -----------
n / n! (m-n)!
But he does not give a name for the formula. Does anyone happen to know what it is called? I need to do some related research.

View 3 Replies View Related

General :: Why Does Running A Program In Bash Work, When Running It In The Menu Doesn't?

Jul 26, 2010

I presume there is something in the JWM window manager - or Puppy Linux Lupu 5.01 itself that is conflicting with the normal loading of GMPLAYER....

I would like to know how to troubleshoot, and fix this problem if possible (even a workaround would be great).

View 1 Replies View Related

General :: Custom Portable Media Player With Xmbc?

Apr 11, 2011

I would like some feed back on how I can take a media player case I bought from net bios flash with tiny-core and set up to load xmbc from the hdd. Its a China made 2" case I'm putting a tb drive in I'm farely sure that it uses a pretty basic mtp sys on its on board memory its compat with many media types but I want to make more types accesable on it and I want the xmbc media browser on it it has ability to playback in hd with hdmi as well as composite/component and s-vid as well as vga using one output like an ipod just plug the cord you need in great for travel and automobile this is device specs [URL]

View 3 Replies View Related

General :: Start Script Bash When System Start Stop Reeboot?

Dec 10, 2009

I have 3 script BASH. I want start this script when the system start,stop and reeboot.

View 4 Replies View Related

Server :: Write A Shell Script Which Will Check IP And Domain Name In Rbl?

Feb 12, 2011

i am trying to write a shell script which will check my IP and domain name in rbl and inform me if it is listed.

View 4 Replies View Related

Programming :: Write A Bash Script That Sources Another Bash Script?

Jan 29, 2011

I am trying to write a bash script that sources another bash script. Essentially, I need a few lines to check to see if a certain variable is set. If not, I set it manually, and then source a scripts with that variable in the path. I wrote a test script to try it, but for some reason the last line does not work. Here is what I wrote:

#!/bin/sh
source ~setupdir/setup.shrc #just a test, this line works
echo ${#SETUP} # prints 0 if setup is not set, which it isn't
if [ ${#SETUP} -eq 0 ]
then
SETUP="~setupdir"
fi
echo $SETUP # prints ~setupdir

[Code]...

View 5 Replies View Related

Security :: Write A Specific Rule To Check For Spoofed Packets?

Apr 21, 2010

Just wanted input for this script i have cobbeled together. Its not done yet. I am trying to think of ways to close up my outgoing while maintaining full functionality of my laptop ( irc, web stuff, a torrent or two, etc.) . Anyways, I have done some myself; as well as, pulling bits and pieces from other stuff out on the web. I am starting to wonder why i have to write a specific rule to check for spoofed packets if my default input is set top drop. wouldnt it be caught?

Code:
#!/bin/bash
### Laptop + Desktop: No Forwarding firewall ip4 / ip6
### Distro > Debian / Ubuntu.
### oliverteasley@gmail.com

[Code]....

View 12 Replies View Related

Programming :: Write A Shell Script Which Will Check A File Name In A Dir And Copy It?

Apr 2, 2010

I am a novice to the shell script. In my system from db server the log files are enerating with the name log1.txt,log2.txt..... It is capable of keeping 10 files at a time in dir called /db/sis/log1.txt. I want to copy the log1.txt to another directory when ever it generating by attaching the time stamp to it for the back-up purpose. this files will be there for a period of 24 hours. after that the back-up dir should be cleared and it start copying again the fresh file from the same dir.

View 3 Replies View Related

General :: Write Shell Script To Check The Modified Date Of A File ?

Jun 17, 2011

I have two linux servers, they are backup together.

1. Server 1 have 3 files with name: file1, file2, file3 in the path: /etc/sysconfig/network-script/.

2. Server 2 have 3 files with name and path are the same as server 1.

- How to make a script to copy 3 files at server1 to overwrite on server2. But before overwrite, this script will check and compare the last modified date of these 3 files(on server1 and server2). if the modified date of file1, file2 or file3 on server1 is newer than 3 files on server2 then overwrite process will do, if not, will do nothing.

- see my script as below: it works find now but just overwrite. not check last modified date.

View 1 Replies View Related

Ubuntu :: Bash If Statement To Check Installed Applications

Jul 14, 2010

I know with if statements in bash you can do
Code:
if [ $fruit = apple ]
then echo "Good, I like Apples"
fi
But I was wondering if you could do something like this:
Code:
if [apt-cache pkgnames smbfs = smbfs doesn't exist]
the apt-get install smbfs
fi
If so how would you capture the output from apt-cache pkgname smbfs to determine if it's installed?

View 9 Replies View Related

Ubuntu :: Bash - Check If All The File Names Are Correct?

Sep 23, 2010

I have bash script for converting files. I have a problem. If file name is "corrupted" then mv command for that file will not work. For example file with "-" in front of the name.

Is there a way to check if in some folder (subfolder) all the files have correct file names or they don't?

If they are all correct -> OK proceed with execution of the script!

If they are not all correct -> NOT OK stop with execution of the script!

View 4 Replies View Related

Ubuntu :: Write A Bash Script That Would Print Processes Using More Than X Mb Or X% Of The CPU?

Mar 14, 2010

i was wondering if anyone could give some advice on how to write a bash script that would print processes using more than x mb or x% of the CPU?

View 2 Replies View Related

Ubuntu :: Write A Bash Script To Create Users?

Oct 17, 2010

I have started using Ubuntu and I have to add a large number of users, over
a thousand, using a Bash Script. I also have to give them a password. Do you create a text file first.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved