Commit ae51c4b8 authored by Joanne Hugé's avatar Joanne Hugé

playbook/ors: give permission to slapuser to launch sdr-util

Patch for callboxes and simboxes
parent dba20458
...@@ -12,4 +12,14 @@ for c in "${COMMAND_LIST[@]}"; do ...@@ -12,4 +12,14 @@ for c in "${COMMAND_LIST[@]}"; do
chmod 440 /etc/sudoers.d/slapuser-$c chmod 440 /etc/sudoers.d/slapuser-$c
fi fi
done done
exit c="sdr-util"
SLAPUSER_LINES="$(cat /etc/sudoers.d/slapuser-$c 2> /dev/null | wc -l)"
AMARISOFT_PATH="/opt/amarisoft/$(ls -1 /opt/amarisoft | grep "^v[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}$" | sort | tail -n1)"
if [ "$SLAPUSER_LINES" != "$PARTITION_AMOUNT" ]; then
echo "Configuring /etc/sudoers.d/slapuser-$c..."
for i in $(seq 0 $(($PARTITION_AMOUNT-1))); do
echo "slapuser$i ALL=NOPASSWD:$AMARISOFT_PATH/trx_sdr/sdr_util -c 0 version" >> slapuser-$c
done
mv slapuser-$c /etc/sudoers.d/
chmod 440 /etc/sudoers.d/slapuser-$c
fi
a4d045699f19693328699f507a2bf51240000f46583b6ac6e85c0b70b84d5ed0 - 3c460573540179069c4f2d86ca1159e0e7c2d18899e971e75613b5ffb65b4f5b -
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment