mirror of
https://github.com/hassio-addons/addon-grocy.git
synced 2025-05-04 11:11:30 +00:00
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Franck Nijhof <git@frenck.dev>
93 lines
2.7 KiB
Text
Executable file
93 lines
2.7 KiB
Text
Executable file
#!/command/with-contenv bashio
|
|
# shellcheck shell=bash
|
|
# ==============================================================================
|
|
# Home Assistant Community Add-on: Grocy
|
|
# Runs the PHP-FPM daemon
|
|
# ==============================================================================
|
|
declare caldayweek
|
|
declare mealday
|
|
export GROCY_CULTURE
|
|
export GROCY_CURRENCY
|
|
export GROCY_ENTRY_PAGE
|
|
|
|
bashio::log.info "Starting PHP-FPM..."
|
|
|
|
if bashio::config.false 'features.batteries'; then
|
|
export GROCY_FEATURE_FLAG_BATTERIES=0
|
|
fi
|
|
|
|
if bashio::config.false 'features.calendar'; then
|
|
export GROCY_FEATURE_FLAG_CALENDAR=0
|
|
fi
|
|
|
|
if bashio::config.false 'features.chores'; then
|
|
export GROCY_FEATURE_FLAG_CHORES=0
|
|
fi
|
|
|
|
if bashio::config.false 'features.equipment'; then
|
|
export GROCY_FEATURE_FLAG_EQUIPMENT=0
|
|
fi
|
|
|
|
if bashio::config.false 'features.recipes'; then
|
|
export GROCY_FEATURE_FLAG_RECIPES=0
|
|
fi
|
|
|
|
if bashio::config.false 'features.shoppinglist'; then
|
|
export GROCY_FEATURE_FLAG_SHOPPINGLIST=0
|
|
fi
|
|
|
|
if bashio::config.false 'features.stock'; then
|
|
export GROCY_FEATURE_FLAG_STOCK=0
|
|
fi
|
|
|
|
if bashio::config.false 'features.tasks'; then
|
|
export GROCY_FEATURE_FLAG_TASKS=0
|
|
fi
|
|
|
|
if bashio::config.has_value 'tweaks.calendar_first_day_of_week'; then
|
|
caldayweek=$(bashio::config 'tweaks.calendar_first_day_of_week')
|
|
export GROCY_CALENDAR_FIRST_DAY_OF_WEEK=${caldayweek}
|
|
fi
|
|
|
|
if bashio::config.false 'tweaks.chores_assignment'; then
|
|
export GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS=0
|
|
fi
|
|
|
|
if bashio::config.has_value 'tweaks.meal_plan_first_day_of_week'; then
|
|
mealday=$(bashio::config 'tweaks.meal_plan_first_day_of_week')
|
|
export GROCY_MEAL_PLAN_FIRST_DAY_OF_WEEK=${mealday}
|
|
fi
|
|
|
|
if bashio::config.false 'tweaks.multiple_shopping_lists'; then
|
|
export GROCY_FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS=0
|
|
fi
|
|
|
|
if bashio::config.false 'tweaks.stock_best_before_date_tracking'; then
|
|
export GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING=0
|
|
fi
|
|
|
|
if bashio::config.false 'tweaks.stock_location_tracking'; then
|
|
export GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING=0
|
|
fi
|
|
|
|
if bashio::config.false 'tweaks.stock_price_tracking'; then
|
|
export GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING=0
|
|
fi
|
|
|
|
if bashio::config.false 'tweaks.stock_product_freezing'; then
|
|
export GROCY_FEATURE_FLAG_STOCK_PRODUCT_FREEZING=0
|
|
fi
|
|
|
|
if bashio::config.false 'tweaks.stock_product_opened_tracking'; then
|
|
export GROCY_FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING=0
|
|
fi
|
|
|
|
if bashio::config.false 'tweaks.stock_count_opened_products_against_minimum_stock_amount'; then
|
|
export GROCY_FEATURE_SETTING_STOCK_COUNT_OPENED_PRODUCTS_AGAINST_MINIMUM_STOCK_AMOUNT=0
|
|
fi
|
|
|
|
GROCY_CULTURE=$(bashio::config "culture")
|
|
GROCY_CURRENCY=$(bashio::config "currency")
|
|
GROCY_ENTRY_PAGE=$(bashio::config 'entry_page')
|
|
|
|
exec php-fpm82 -R --nodaemonize
|