Commit 56681f74 authored by Joanne Hugé's avatar Joanne Hugé

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

Patch for callboxes and simboxes
parent bc9278a4
...@@ -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
aa42c27685d0638e782967060d77a07044c179046043128fc712d5880dda1383 - 8df60f2f0c5c3c5eec736dc6274af83bd056222895d4381abc9a8f3c6a63e367 -
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