Skip to content

Instantly share code, notes, and snippets.

@Ingo-FP-Angel
Last active January 3, 2019 13:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ingo-FP-Angel/905c5655511435b0ded2eb354dab538b to your computer and use it in GitHub Desktop.
Save Ingo-FP-Angel/905c5655511435b0ded2eb354dab538b to your computer and use it in GitHub Desktop.
Add missing aethercast setting for apparmor in Ubuntu Touch 16.04 (xenial)
#!/bin/bash -x
if (( $EUID != 0 )); then
FULLFILENAME=$(readlink -e $0)
sudo -i "$FULLFILENAME"
exit
fi
if !(grep -q "aethercast" /etc/apparmor.d/sbin.dhclient); then
echo "Updating /etc/apparmor.d/sbin.dhclient"
mount -o rw,remount /
cp /etc/apparmor.d/sbin.dhclient /etc/apparmor.d/sbin.dhclient.bak
ADDLINES=' # aethercast\n \/{,var\/}run\/aethercast\/dhclient*.leases lrw,\n\n'
sed -e "s/ # if there is a custom script, let it run unconfined/${ADDLINES} # if there is a custom script, let it run unconfined/" < /etc/apparmor.d/sbin.dhclient.bak > /etc/apparmor.d/sbin.dhclient
mount -o ro,remount /
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment