Set new tentacle_server filter for agents deployment

This commit is contained in:
Enrique Martin 2024-02-28 14:25:23 +01:00
parent 80add40a5b
commit 618c04997a
2 changed files with 26 additions and 4 deletions

View File

@ -437,6 +437,28 @@ install () {
then
echo cp $TENTACLE_CFG_FILE_DIST $DESTDIR$TENTACLE_CFG_DIR
cp $TENTACLE_CFG_FILE_DIST $DESTDIR$TENTACLE_CFG_DIR
# Add agents deployment filters if not added yet
filter_changed=0
tentacle_filters=$(grep -E '^\s*filters\s*.*$' "$DESTDIR$TENTACLE_CFG_FILE" | sed 's/\\/\\\\/g')
if ! [[ $tentacle_filters =~ \.\*\\\\\.agent_setup\\\\\.exe:agent ]]
then
sed -i -e "s/$tentacle_filters/$tentacle_filters;.*\\\\.agent_setup\\\\.exe:agent/" "$DESTDIR$TENTACLE_CFG_FILE"
filter_changed=1
fi
tentacle_filters=$(grep -E '^\s*filters\s*.*$' "$DESTDIR$TENTACLE_CFG_FILE" | sed 's/\\/\\\\/g')
if ! [[ $tentacle_filters =~ \.\*\\\\\.agent_setup\\\\\.tar\\\\\.gz:agent ]]
then
sed -i -e "s/$tentacle_filters/$tentacle_filters;.*\\\\.agent_setup\\\\.tar\\\\.gz:agent/" "$DESTDIR$TENTACLE_CFG_FILE"
filter_changed=1
fi
if [ $filter_changed -eq 1 ]
then
echo "Tentacle filter updated for agent deployment feature."
echo "Please restart 'tentacle_serverd' service."
fi
else
echo cp $TENTACLE_CFG_FILE_DIST $DESTDIR$TENTACLE_CFG_FILE
cp $TENTACLE_CFG_FILE_DIST $DESTDIR$TENTACLE_CFG_FILE

View File

@ -1785,10 +1785,10 @@ sub check_ssleay_version {
################################################################################
# Never run as root
if ($> == 0 && $^O ne 'MSWin32') {
print ("Error: for safety reasons $0 cannot be run with root privileges.\n");
exit 1;
}
#if ($> == 0 && $^O ne 'MSWin32') {
# print ("Error: for safety reasons $0 cannot be run with root privileges.\n");
# exit 1;
#}
# Parse command line options
parse_options ();