-
Notifications
You must be signed in to change notification settings - Fork 0
/
append.to.sudoers
52 lines (38 loc) · 1.17 KB
/
append.to.sudoers
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#! /bin/bash
#
# (C) Copyright 2012, 2018 by Northwestern University
# Author: Keith Brister
#
#
# Lines to add to sudoers
#
zzs[1]="ALL ALL=NOPASSWD: /usr/bin/killall -q pxMarServer.py"
zzs[2]="ALL ALL=NOPASSWD: /usr/bin/killall -q marccd"
zzs[3]="ALL ALL=NOPASSWD: /usr/bin/killall -q -s KILL pxMarServer.py"
zzs[4]="ALL ALL=NOPASSWD: /usr/bin/killall -q -s KILL marccd"
zzs[5]="ALL ALL=NOPASSWD: /usr/local/bin/fixMarccdLog"
zzs[6]="ALL ALL=NOPASSWD: /usr/local/bin/AutoDetector.py"
zzs[7]="ALL ALL=NOPASSWD: /sbin/modprobe marMosaic"
zzs[8]="ALL ALL=(elena) NOPASSWD: /usr/bin/screen -d -m /pf/epics/lscat/lscatApp/tcl/lsmono"
zzs[9]="ALL ALL=(elena) NOPASSWD: /usr/bin/screen -d -m /pf/epics/lscat/lscatApp/tcl/pezca_wrapper2 attenuationServer.pl *"
#
# only use these computers
#
vcomps=(vidalia venison vanilla vinegar)
#
# see if our computer is allowed
#
for vc in ${vcomps[@]}; do
if [[ `hostname -a`"zz" = ${vc}"zz" ]]; then
#
# save the old version in case we screw up
#
cp /etc/sudoers /tmp/sudoers.copy
ii=0;
while [[ $ii < ${#zzs[*]} ]]; do
ll=${zzs[$ii]}
grep -q "^${ll}" /etc/sudoers || echo $ll >>/etc/sudoers
let ii=$ii+1
done
fi
done