Files
webgui/plugins/dynamix.plugin.manager/scripts/plugin_rm
2022-08-11 21:02:22 +02:00

19 lines
423 B
Bash
Executable File

#!/bin/bash
write(){
for message in "$@"; do
curl -sfd "$message" --unix-socket /var/run/nginx.socket http://localhost/pub/plugins?buffer_length=1 >/dev/null 2>&1
done
}
# put some restrictions on 'delete'
if [[ $1 == /boot/config/plugins-error/* || $1 == /boot/config/plugins-stale/* ]]; then
text="Deleting $1 ..."
if [[ -z $2 ]]; then
echo "$text"
else
write "$text " "_DONE_" ""
fi
rm $1
fi