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