Wrap echo output in bash shell so sudo works

This commit is contained in:
Quad 2021-05-20 14:32:48 +02:00
parent e5e29d5c8d
commit ba77bdcfa3
1 changed files with 5 additions and 1 deletions

View File

@ -98,7 +98,11 @@ set_pl () {
elif [ $1 -eq 2 ]; then elif [ $1 -eq 2 ]; then
pl_path=$pl2_path pl_path=$pl2_path
fi fi
if [ "$EUID" -eq 0 ]; then
echo $(w_to_uw $2) > $pl_path echo $(w_to_uw $2) > $pl_path
else
sudo bash -c "echo $(w_to_uw $2) > ${pl_path}"
fi
else else
exit 1 exit 1
fi fi