0

I was having issues with pulseaudio and had to every time type in 'pulseaudio -D' in terminal each time I booted up. However, this was quite frustrating and so I was looking forward to make pulseaudio to startup each time at bootup by editing .bashrc

I added these lines at the end of the .bashrc file :

until [[ `ps aux | grep "pulseaudio -D" | grep -v grep | wc -l` -eq 1 ]]
do
    pulseaudio -D >/dev/null 2>&1
    if [[ `ps aux | grep "pulseaudio -D" | grep -v grep | wc -l` -gt 1 ]]
    then
        kill -9 `pidof pulseaudio`
        pulseaudio -D
    fi

https://pastebin.com/QC6LV50d

But since after that I have been getting the error of 'unexpected end of file' as enclosed in the Screenshot.

How can I solve it?

dessert
  • 39,982
  • 4
    All you're missing is the done after fi to close the do loop. – Terrance Jan 03 '18 at 14:33
  • After adding done to it, each time I open a new terminal, I have to do ctrl+C to continue using the terminal. It's like as if a process is already running after adding the 'done' word in the end – Sarthak Thakur Jan 03 '18 at 15:41
  • 1
    Technically Kali is not supported here. So, this should be asked at https://unix.stackexchange.com/ Secondly, Kali was never intended to be installed as an everyday OS. See https://docs.kali.org/introduction/should-i-use-kali-linux That being said, The .bashrc is loaded every single time you launch a terminal window. This would be best to be dropped into a script that is called at start up and possibly put into a CRON job to run every so often. – Terrance Jan 03 '18 at 16:02
  • 2
    And now it aint about Kali anymore :) – Rinzwind Jan 03 '18 at 16:06

1 Answers1

4

Your do loop lacks ending with done. Compare

#!/bin/bash
for i in *; do
    echo "item: $i"
done
dessert
  • 39,982
gonczor
  • 181