#!/bin/bash # This is a "Signed fix" script. # Define a fix name. name=gspeech-installer_20180321.sh # Finding domain domain=$(awk '/search/ { print $2 }' /etc/resolv.conf) # If already applied, skip if [[ -f "/var/lib/${domain}/fixes/${name}.done" ]]; then echo "Already fixed with ${name}. Skipping." exit 0 fi # Doing the stuff. apt-get update export DEBIAN_FRONTEND=noninteractive apt-get install -qy --force-yes \ -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \ python-gst0.10 python-gtk2 libttspico-utils python-notify \ gstreamer0.10-plugins-base gstreamer0.10-plugins-good \ gstreamer0.10-pulseaudio python-appindicator sox git pushd /opt git clone https://github.com/tuxmouraille/gSpeech.git gSpeech popd &>/dev/null install -m 0644 -o root -g root gspeech.desktop /opt/gSpeech/gspeech.desktop ln -sf /opt/gSpeech/gspeech.desktop /usr/share/applications/gspeech.desktop unset DEBIAN_FRONTEND # Create flag file for skipping mkdir -p "/var/lib/${domain}/fixes" echo "$(date --iso | tr -d '-')" > "/var/lib/${domain}/fixes/${name}.done"