|
@@ -2102,6 +2102,38 @@ function wifi_enable {
|
2102
|
2102
|
${PROJECT_NAME}-wifi --disable $disable_wifi
|
2103
|
2103
|
}
|
2104
|
2104
|
|
|
2105
|
+function add_clacks {
|
|
2106
|
+ clacks=
|
|
2107
|
+
|
|
2108
|
+ data=$(tempfile 2>/dev/null)
|
|
2109
|
+ trap "rm -f $data" 0 1 2 5 15
|
|
2110
|
+ dialog --title $"Add Clacks Overhead" \
|
|
2111
|
+ --backtitle $"Freedombone Control Panel" \
|
|
2112
|
+ --inputbox $"" 7 60 2>$data
|
|
2113
|
+ sel=$?
|
|
2114
|
+ case $sel in
|
|
2115
|
+ 0)
|
|
2116
|
+ clacks=$(<$data)
|
|
2117
|
+ if [ ${#clacks} -gt 1 ]; then
|
|
2118
|
+
|
|
2119
|
+ WEB_FILES=/etc/nginx/sites-available/*
|
|
2120
|
+ for f in $WEB_FILES
|
|
2121
|
+ do
|
|
2122
|
+ if grep -q "X-Clacks-Overhead" $f; then
|
|
2123
|
+ sed -i "s|X-Clacks-Overhead .*|X-Clacks-Overhead \"GNU $clacks\";|g" $f
|
|
2124
|
+ else
|
|
2125
|
+ sed -i "/X-Content-Type-Options/a add_header X-Clacks-Overhead \"GNU $clacks\";" $f
|
|
2126
|
+ fi
|
|
2127
|
+ done
|
|
2128
|
+
|
|
2129
|
+ dialog --title $"Add Clacks Overhead" \
|
|
2130
|
+ --msgbox $"\nAdded for $clacks" 10 60
|
|
2131
|
+ fi
|
|
2132
|
+ ;;
|
|
2133
|
+ esac
|
|
2134
|
+ rm $data
|
|
2135
|
+}
|
|
2136
|
+
|
2105
|
2137
|
function menu_wifi {
|
2106
|
2138
|
if [[ "$(wifi_exists)" == "0" ]]; then
|
2107
|
2139
|
dialog --title $"Wifi" \
|
|
@@ -2191,7 +2223,7 @@ function menu_top_level {
|
2191
|
2223
|
trap "rm -f $data" 0 1 2 5 15
|
2192
|
2224
|
dialog --backtitle $"Freedombone Control Panel" \
|
2193
|
2225
|
--title $"Control Panel" \
|
2194
|
|
- --radiolist $"Choose an operation:" 29 70 21 \
|
|
2226
|
+ --radiolist $"Choose an operation:" 30 70 22 \
|
2195
|
2227
|
1 $"About this system" off \
|
2196
|
2228
|
2 $"Passwords" off \
|
2197
|
2229
|
3 $"Backup and Restore" off \
|
|
@@ -2209,10 +2241,11 @@ function menu_top_level {
|
2209
|
2241
|
15 $"Change the name of this system" off \
|
2210
|
2242
|
16 $"Set a static local IP address" off \
|
2211
|
2243
|
17 $"Wifi menu" off \
|
2212
|
|
- 18 $"Check for updates" off \
|
2213
|
|
- 19 $"Power off the system" off \
|
2214
|
|
- 20 $"Restart the system" off \
|
2215
|
|
- 21 $"Exit" on 2> $data
|
|
2244
|
+ 18 $"Add Clacks" off \
|
|
2245
|
+ 19 $"Check for updates" off \
|
|
2246
|
+ 20 $"Power off the system" off \
|
|
2247
|
+ 21 $"Restart the system" off \
|
|
2248
|
+ 22 $"Exit" on 2> $data
|
2216
|
2249
|
sel=$?
|
2217
|
2250
|
case $sel in
|
2218
|
2251
|
1) exit 1;;
|
|
@@ -2242,10 +2275,11 @@ function menu_top_level {
|
2242
|
2275
|
15) change_system_name;;
|
2243
|
2276
|
16) set_static_IP;;
|
2244
|
2277
|
17) menu_wifi;;
|
2245
|
|
- 18) check_for_updates;;
|
2246
|
|
- 19) shut_down_system;;
|
2247
|
|
- 20) restart_system;;
|
2248
|
|
- 21) break;;
|
|
2278
|
+ 18) add_clacks;;
|
|
2279
|
+ 19) check_for_updates;;
|
|
2280
|
+ 20) shut_down_system;;
|
|
2281
|
+ 21) restart_system;;
|
|
2282
|
+ 22) break;;
|
2249
|
2283
|
esac
|
2250
|
2284
|
done
|
2251
|
2285
|
}
|