chiark / gitweb /
Bump to 0.7.0
[fdroidserver.git] / buildserver / fixpaths.sh
1 #!/bin/sh
2
3 echo $0
4
5 fixit()
6 {
7   #Fix sudoers so the PATH gets passed through, otherwise chef
8   #provisioning doesn't work.
9   if [ -z "$1" ]; then
10     export EDITOR=$0 && sudo -E visudo
11   else
12     echo "Fix sudoers"
13     echo "Defaults exempt_group=admin" >> $1
14   fi
15   #Stick the gems bin onto root's path as well.
16   sudo echo "PATH=$PATH:/var/lib/gems/1.8/bin" >>/root/.bashrc
17   # Restart sudo so it gets the changes straight away
18   sudo /etc/init.d/sudo restart
19 }
20
21 sudo grep "exempt_group" /etc/sudoers -q
22 if [ "$?" -eq "1" ]; then
23   fixit
24 fi
25