summaryrefslogtreecommitdiffstats
path: root/sbin/asound_pulse_enable.sh
blob: c3d0caeb626bb38dba7ecf47710e33adf1e9ead5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

asound_backup.sh

tmpfile=`mktemp`
if [ -z "`grep "^[^#]*ctl.\!default" /etc/asound.conf`" ]
then
    echo "ctl.!default {
	type pulse
}
" > $tmpfile   

    cat -s /etc/asound.conf >> $tmpfile
    cat -s "$tmpfile" > /etc/asound.conf
fi

if [ -z "`grep "^[^#]*pcm.\!default" /etc/asound.conf`" ]
then
	echo "pcm.!default {
	type pulse
}
" > $tmpfile
	
	cat -s /etc/asound.conf >> $tmpfile	
	cat -s "$tmpfile" > /etc/asound.conf
fi