~nilarimogard/jupiterapplet/oneiric+precise

« back to all changes in this revision

Viewing changes to init.d/jupiter-healthcheck

  • Committer: Andrew
  • Date: 2012-01-17 15:59:07 UTC
  • Revision ID: andrew@webupd8.org-20120117155907-zqj1uen8w0q2mvk8
revert postinst update, jupiter doesn't work anymore with it (no more sudo rights)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
#
 
3
### BEGIN INIT INFO
 
4
# Provides:          jupiter-healthcheck
 
5
# Default-Start:     2 3 4 5
 
6
# Default-Stop:      1 6
 
7
# Required-Start:
 
8
# Required-Stop:
 
9
# Short-Description: Auto corrects simple issues with Jupiter configuration
 
10
### END INIT INFO
 
11
 
 
12
# set -e
 
13
. /lib/lsb/init-functions
 
14
 
 
15
case "$1" in
 
16
*)
 
17
  ### Correct problems with sudoers ordering
 
18
  SLAST=$((/usr/bin/tail -n 1 /etc/sudoers | /bin/grep jupiter) && echo OK)
 
19
  if [ "$SLAST" = "" ]; then
 
20
    echo "Jupiter: Autocorrecting issue with sudoers"
 
21
    /bin/sed -i /^%jupit.*\$/d /etc/sudoers
 
22
    echo "%jupiter ALL=NOPASSWD: /usr/lib/jupiter/scripts/bluetooth, /usr/lib/jupiter/scripts/camera, /usr/lib/jupiter/scripts/cpu-control, /usr/lib/jupiter/scripts/resolutions, /usr/lib/jupiter/scripts/rotate, /usr/lib/jupiter/scripts/touchpad, /usr/lib/jupiter/scripts/vga-out, /usr/lib/jupiter/scripts/wifi" >> /etc/sudoers
 
23
  fi
 
24
;;
 
25
esac
 
26
 
 
27
exit 0