forked from hassio-addons/app-grocy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun
More file actions
executable file
·151 lines (118 loc) · 4.52 KB
/
run
File metadata and controls
executable file
·151 lines (118 loc) · 4.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/command/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Home Assistant Community Add-on: Grocy
# Runs the PHP-FPM daemon
# ==============================================================================
declare caldayweek
declare mealday
declare label_printer_webhook
declare label_printer_params
declare tprinter_ip
declare tprinter_port
declare tprinter_connector
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.true 'features.label_printer'; then
export GROCY_FEATURE_FLAG_LABEL_PRINTER=1
fi
if bashio::config.true 'features.thermal_printer'; then
export FEATURE_FLAG_THERMAL_PRINTER=1
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
if bashio::config.has_value 'tweaks.label_printer_webhook'; then
label_printer_webhook=$(bashio::config 'tweaks.label_printer_webhook')
export LABEL_PRINTER_WEBHOOK=${label_printer_webhook}
fi
if bashio::config.false 'tweaks.label_printer_run_server'; then
export GROCY_LABEL_PRINTER_RUN_SERVER=0
fi
if bashio::config.has_value 'tweaks.label_printer_params'; then
label_printer_params=$(bashio::config 'tweaks.label_printer_params')
export GROCY_LABEL_PRINTER_PARAMS=${label_printer_params}
fi
if bashio::config.true 'tweaks.label_printer_hook_json'; then
export GROCY_LABEL_PRINTER_HOOK_JSON=1
fi
if bashio::config.true 'tweaks.tprinter_is_network_printer'; then
export GROCY_TPRINTER_IS_NETWORK_PRINTER=1
fi
if bashio::config.false 'tweaks.tprinter_print_quantity_name'; then
export GROCY_TPRINTER_PRINT_QUANTITY_NAME=0
fi
if bashio::config.false 'tweaks.tprinter_print_notes'; then
export GROCY_TPRINTER_PRINT_NOTES=0
fi
if bashio::config.has_value 'tweaks.tprinter_ip'; then
tprinter_ip=$(bashio::config 'tweaks.tprinter_ip')
export GROCY_TPRINTER_IP=${tprinter_ip}
fi
if bashio::config.has_value 'tweaks.tprinter_port'; then
tprinter_port=$(bashio::config 'tweaks.tprinter_port')
export GROCY_TPRINTER_PORT=${tprinter_port}
fi
if bashio::config.has_value 'tweaks.tprinter_connector'; then
tprinter_connector=$(bashio::config 'tweaks.tprinter_connector')
export GROCY_TPRINTER_CONNECTOR=${tprinter_connector}
fi
GROCY_CULTURE=$(bashio::config "culture")
GROCY_CURRENCY=$(bashio::config "currency")
GROCY_ENTRY_PAGE=$(bashio::config 'entry_page')
exec php-fpm82 -R --nodaemonize