Kinda finished

This commit is contained in:
llnu 2020-05-11 12:22:40 +02:00
parent 3141840cf4
commit 2275037039
2 changed files with 30 additions and 4 deletions

View file

@ -1,3 +1,23 @@
if grep -q "^__your_type/object/id:conf_file_changed" "$__messages_in"; then os=$(cat "$__global/explorer/os")
echo "service nginx reload"
fi #if grep -q "$something_from_message_in" "$__messages_in"; then
case "${os}" in
alpine|gentoo)
echo /etc/init.d/nginx reload
;;
debian|ubuntu)
echo "/usr/bin/systemctl reload nginx"
;;
esac
#fi
#if grep -q "^__your_type/object/id:conf_file_changed" "$__messages_in"; then
# echo "$reload_command"
#fi
# Testing env -> variables are not shared between the type's manifest and the gencode-remote script
# Maybe the variables are eval-ed on the local host and won't get transferred to the remote host?
#echo "echo \"$reload_command\" >> /tmp/cmd"

View file

@ -1,3 +1,8 @@
os="$(cat "$__global/explorer/os")"
# Note: __service nginx --action reload
domain="$__object_id" domain="$__object_id"
nginx_config_dir="/etc/nginx/conf.d" nginx_config_dir="/etc/nginx/conf.d"
@ -15,4 +20,5 @@ server {
} }
EOF EOF
echo "conf_file_changed" >> "$__messages_out" # Messaging is not needed because atm I assume that the config file will get overwritten every run, even if the contents are the same.
#echo "conf_file_changed" >> "$__messages_out"