SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-10-10 17:11:58

jmad2011
#! CrunchBanger
From: newton falls ohio
Registered: 2011-12-25
Posts: 197

Mpd Script (Frist script i wrote but thinks theres some problems)

im atempting to write a script to install mpd just to make it simple on myself cause i switch distro's alot figured it would make life simple   


#!/bin/sh
  
apt-get update
     
#mpd
 apt-get install mpd mpc 

 #configure mpd   

 sudo service mpd stop  

sudo update-rc.d mpd disable 
#directories
mkdir -p ~/.mpd/playlists 

sudo gunzip -c /usr/share/doc/mpd/examples/mpd.conf.gz > ~/.mpd/mpd.conf 


touch ~/.mpd/{mpd.db,mpd.log,mpd.pid,mpdstate}
     

doesn't create the files with the touch cammand but does if i run it with bash -xv


Say your prayer's,Eat your vitamins....AND WHAT YOU GONNA DO BROTHA

Offline

Help fund CrunchBang, donate to the project!

#2 2012-10-10 17:25:36

Unia
#! Die Hard
From: The Netherlands
Registered: 2010-07-17
Posts: 3,111

Re: Mpd Script (Frist script i wrote but thinks theres some problems)

NVM, didn't read properly.

Last edited by Unia (2012-10-10 17:26:00)


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
      Github || Deviantart

Offline

#3 2012-10-10 18:22:30

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,301

Re: Mpd Script (Frist script i wrote but thinks theres some problems)

The 'sh' - dash - does not recognize the {arg1,arg2,  } notation, bash does.

Offline

#4 2012-10-10 18:32:53

jmad2011
#! CrunchBanger
From: newton falls ohio
Registered: 2011-12-25
Posts: 197

Re: Mpd Script (Frist script i wrote but thinks theres some problems)

xaos52 wrote:

The 'sh' - dash - does not recognize the {arg1,arg2,  } notation, bash does.


still learning this so that was was like latin


Say your prayer's,Eat your vitamins....AND WHAT YOU GONNA DO BROTHA

Offline

#5 2012-10-10 18:33:49

Unia
#! Die Hard
From: The Netherlands
Registered: 2010-07-17
Posts: 3,111

Re: Mpd Script (Frist script i wrote but thinks theres some problems)

Aka change #!/bin/sh to #!/bin/bash


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
      Github || Deviantart

Offline

#6 2012-10-10 19:36:28

jmad2011
#! CrunchBanger
From: newton falls ohio
Registered: 2011-12-25
Posts: 197

Re: Mpd Script (Frist script i wrote but thinks theres some problems)

Unia wrote:

Aka change #!/bin/sh to #!/bin/bash


i feel quite dumb now lmao


Say your prayer's,Eat your vitamins....AND WHAT YOU GONNA DO BROTHA

Offline

#7 2012-10-10 20:28:35

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,644

Re: Mpd Script (Frist script i wrote but thinks theres some problems)

Remove sudo here:

sudo gunzip -c /usr/share/doc/mpd/examples/mpd.conf.gz > ~/.mpd/mpd.conf 

Otherwise the file will be owned by root. And you don't need sudo privileges to extract stuff from /usr/share/doc. So:

gunzip -c /usr/share/doc/mpd/examples/mpd.conf.gz > ~/.mpd/mpd.conf

But his won't work either, as the default configuration has the playlist, database and other files in /var/lib or somewhere. You need a user specific config. So upload one to dropbox or a VCS and add that to the script.

Offline

#8 2012-10-15 17:18:46

jmad2011
#! CrunchBanger
From: newton falls ohio
Registered: 2011-12-25
Posts: 197

Re: Mpd Script (Frist script i wrote but thinks theres some problems)

i cheated and just built a dedicated mpd box


Say your prayer's,Eat your vitamins....AND WHAT YOU GONNA DO BROTHA

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo