Skip to content

Instantly share code, notes, and snippets.

@EncryptedCurse
Created June 27, 2021 17:40
Show Gist options
  • Save EncryptedCurse/95a77a87f1f2a76bb3bbe5c495ebf0ac to your computer and use it in GitHub Desktop.
Save EncryptedCurse/95a77a87f1f2a76bb3bbe5c495ebf0ac to your computer and use it in GitHub Desktop.
Andronix sound fix script (deobfuscated): https://docs.andronix.app/hardware/sound
pkg install pulseaudio
dir=$(pwd)
if grep -q "anonymous" ~/../usr/etc/pulse/default.pa
then
echo "module already present"
else
echo "load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" >> ~/../usr/etc/pulse/default.pa
fi
if grep -q "exit-idle" ~/../usr/etc/pulse/daemon.conf
then
sed -i '\''/exit-idle/d'\'' ~/../usr/etc/pulse/daemon.conf
echo "exit-idle-time = 180" >> ~/../usr/etc/pulse/daemon.conf
echo "modiefied timeout to 180 seconds"
else
echo "exit-idle-time = 180" >> ~/../usr/etc/pulse/daemon.conf
echo "modiefied timeout to 180 seconds"
fi
if [ -e $dir/ubuntu-fs/root/.vnc/xstartup ];
then
if grep -q "PULSE_SERVER" $dir/ubuntu-fs/root/.vnc/xstartup
then
sed -i '\''/PULSE/d'\'' $dir/ubuntu-fs/root/.vnc/xstartup
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/ubuntu-fs/root/.vnc/xstartup
else
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/ubuntu-fs/root/.vnc/xstartup
fi
fi
if [ -e $dir/ubuntu19-fs/root/.vnc/xstartup ];
then
if grep -q "PULSE_SERVER" $dir/ubuntu19-fs/root/.vnc/xstartup
then
sed -i '\''/PULSE/d'\'' $dir/ubuntu19-fs/root/.vnc/xstartup
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/ubuntu19-fs/root/.vnc/xstartup
else
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/ubuntu19-fs/root/.vnc/xstartup
fi
fi
if [ -e $dir/debian-fs/root/.vnc/xstartup ];
then
if grep -q "PULSE_SERVER" $dir/debian-fs/root/.vnc/xstartup
then
sed -i '\''/PULSE/d'\'' $dir/debian-fs/root/.vnc/xstartup
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/debian-fs/root/.vnc/xstartup
else
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/debian-fs/root/.vnc/xstartup
fi
fi
if [ -e $dir/kali-fs/root/.vnc/xstartup ];
then
if grep -q "PULSE_SERVER" $dir/kali-fs/root/.vnc/xstartup
then
sed -i '\''/PULSE/d'\'' $dir/kali-fs/root/.vnc/xstartup
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/kali-fs/root/.vnc/xstartup
else
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/kali-fs/root/.vnc/xstartup
fi
fi
if [ -e $dir/arch-fs/root/.vnc/xstartup ];
then
if grep -q "PULSE_SERVER" $dir/arch-fs/root/.vnc/xstartup
then
sed -i '\''/PULSE/d'\'' $dir/arch-fs/root/.vnc/xstartup
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/arch-fs/root/.vnc/xstartup
else
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/arch-fs/root/.vnc/xstartup
fi
fi
if [ -e $dir/manjaro-fs/root/.vnc/xstartup ];
then
if grep -q "PULSE_SERVER" $dir/manjaro-fs/root/.vnc/xstartup
then
sed -i '\''/PULSE/d'\'' $dir/manjaro-fs/root/.vnc/xstartup
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/manjaro-fs/root/.vnc/xstartup
else
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/manjaro-fs/root/.vnc/xstartup
fi
fi
if [ -e $dir/fedora-fs/root/.vnc/xstartup ];
then
if grep -q "PULSE_SERVER" $dir/fedora-fs/root/.vnc/xstartup
then
sed -i '\''/PULSE/d'\'' $dir/fedora-fs/root/.vnc/xstartup
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/fedora-fs/root/.vnc/xstartup
else
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/fedora-fs/root/.vnc/xstartup
fi
fi
if [ -e $dir/void-fs/root/.vnc/xstartup ];
then
if grep -q "PULSE_SERVER" $dir/void-fs/root/.vnc/xstartup
then
sed -i '\''/PULSE/d'\'' $dir/void-fs/root/.vnc/xstartup
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/void-fs/root/.vnc/xstartup
else
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/void-fs/root/.vnc/xstartup
fi
fi
if [ -e $dir/alpine-fs/root/.vnc/xstartup ];
then
if grep -q "PULSE_SERVER" $dir/alpine-fs/root/.vnc/xstartup
then
sed -i '\''/PULSE/d'\'' $dir/alpine-fs/root/.vnc/xstartup
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/alpine-fs/root/.vnc/xstartup
else
sed -i '\''2 a export PULSE_SERVER=127.0.0.1'\'' $dir/alpine-fs/root/.vnc/xstartup
fi
fi
if [ -e $dir/start-ubuntu.sh ]
then
if grep -q "pulseaudio" $dir/start-ubuntu.sh
then
sed -i '\''/pulseaudio/d'\'' $dir/start-ubuntu.sh
sed -i '\''2 a pulseaudio --start'\'' $dir/start-ubuntu.sh
else
sed -i '\''2 a pulseaudio --start'\'' $dir/start-ubuntu.sh
fi
fi
if [ -e $dir/start-ubuntu19.sh ]
then
if grep -q "pulseaudio" $dir/start-ubuntu19.sh
then
sed -i '\''/pulseaudio/d'\'' $dir/start-ubuntu19.sh
sed -i '\''2 a pulseaudio --start'\'' $dir/start-ubuntu19.sh
else
sed -i '\''2 a pulseaudio --start'\'' $dir/start-ubuntu19.sh
fi
fi
if [ -e $dir/start-debian.sh ]
then
if grep -q "pulseaudio" $dir/start-debian.sh
then
sed -i '\''/pulseaudio/d'\'' $dir/start-debian.sh
sed -i '\''2 a pulseaudio --start'\'' $dir/start-debian.sh
else
sed -i '\''2 a pulseaudio --start'\'' $dir/start-debian.sh
fi
fi
if [ -e $dir/start-kali.sh ]
then
if grep -q "pulseaudio" $dir/start-kali.sh
then
sed -i '\''/pulseaudio/d'\'' $dir/start-kali.sh
sed -i '\''2 a pulseaudio --start'\'' $dir/start-kali.sh
else
sed -i '\''2 a pulseaudio --start'\'' $dir/start-kali.sh
fi
fi
if [ -e $dir/start-arch.sh ]
then
if grep -q "pulseaudio" $dir/start-arch.sh
then
sed -i '\''/pulseaudio/d'\'' $dir/start-arch.sh
sed -i '\''2 a pulseaudio --start'\'' $dir/start-arch.sh
else
sed -i '\''2 a pulseaudio --start'\'' $dir/start-arch.sh
fi
fi
if [ -e $dir/start-manjaro.sh ]
then
if grep -q "pulseaudio" $dir/start-manjaro.sh
then
sed -i '\''/pulseaudio/d'\'' $dir/start-manjaro.sh
sed -i '\''2 a pulseaudio --start'\'' $dir/start-manjaro.sh
else
sed -i '\''2 a pulseaudio --start'\'' $dir/start-manjaro.sh
fi
fi
if [ -e $dir/start-fedora.sh ]
then
if grep -q "pulseaudio" $dir/start-fedora.sh
then
sed -i '\''/pulseaudio/d'\'' $dir/start-fedora.sh
sed -i '\''2 a pulseaudio --start'\'' $dir/start-fedora.sh
else
sed -i '\''2 a pulseaudio --start'\'' $dir/start-fedora.sh
fi
fi
if [ -e $dir/start-void.sh ]
then
if grep -q "pulseaudio" $dir/start-void.sh
then
sed -i '\''/pulseaudio/d'\'' $dir/start-void.sh
sed -i '\''2 a pulseaudio --start'\'' $dir/start-void.sh
else
sed -i '\''2 a pulseaudio --start'\'' $dir/start-void.sh
fi
fi
if [ -e $dir/start-alpine.sh ]
then
if grep -q "pulseaudio" $dir/start-alpine.sh
then
sed -i '\''/pulseaudio/d'\'' $dir/start-alpine.sh
sed -i '\''2 a pulseaudio --start'\'' $dir/start-alpine.sh
else
sed -i '\''2 a pulseaudio --start'\'' $dir/start-alpine.sh
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment