|
@@ -1780,8 +1780,8 @@ function show_firewall {
|
1780
|
1780
|
echo $"Firewall Settings"
|
1781
|
1781
|
echo ''
|
1782
|
1782
|
while read -r line; do
|
1783
|
|
- firewall_name=$(awk "$line" -F '=' '{print $1}')
|
1784
|
|
- firewall_port=$(awk "$line" -F '=' '{print $2}')
|
|
1783
|
+ firewall_name=$(echo "$line" | awk -F '=' '{print $1}')
|
|
1784
|
+ firewall_port=$(echo "$line" | awk -F '=' '{print $2}')
|
1785
|
1785
|
echo -n -e "$(pad_string "${firewall_name}")"
|
1786
|
1786
|
echo "${firewall_port}"
|
1787
|
1787
|
done < "$FIREWALL_CONFIG"
|
|
@@ -1881,29 +1881,25 @@ function email_smtp_proxy {
|
1881
|
1881
|
function menu_backup_restore {
|
1882
|
1882
|
while true
|
1883
|
1883
|
do
|
1884
|
|
- data=$(mktemp 2>/dev/null)
|
1885
|
|
- dialog --backtitle $"Freedombone Control Panel" \
|
1886
|
|
- --title $"Backup and Restore" \
|
1887
|
|
- --radiolist $"Choose an operation:" 19 70 12 \
|
1888
|
|
- 1 $"Backup data to USB drive" off \
|
1889
|
|
- 2 $"Restore GPG key from USB keydrive" off \
|
1890
|
|
- 3 $"Restore data from USB drive" off \
|
1891
|
|
- 4 $"Reinstall mariadb" off \
|
1892
|
|
- 5 $"Configure remote backups" off \
|
1893
|
|
- 6 $"Restore from remote backup" off \
|
1894
|
|
- 7 $"Backup GPG key to USB (master keydrive)" off \
|
1895
|
|
- 8 $"Backup GPG key to USB (fragment keydrive)" off \
|
1896
|
|
- 9 $"Format a USB drive (LUKS encrypted)" off \
|
1897
|
|
- 10 $"Remove backups from a USB drive" off \
|
1898
|
|
- 11 $"Back to main menu" on 2> "$data"
|
1899
|
|
- sel=$?
|
1900
|
|
- case $sel in
|
1901
|
|
- 1) rm -f "$data"
|
1902
|
|
- break;;
|
1903
|
|
- 255) rm -f "$data"
|
1904
|
|
- break;;
|
1905
|
|
- esac
|
1906
|
|
- case $(cat "$data") in
|
|
1884
|
+ W=(1 $"Backup data to USB drive"
|
|
1885
|
+ 2 $"Restore GPG key from USB keydrive"
|
|
1886
|
+ 3 $"Restore data from USB drive"
|
|
1887
|
+ 4 $"Reinstall mariadb"
|
|
1888
|
+ 5 $"Configure remote backups"
|
|
1889
|
+ 6 $"Restore from remote backup"
|
|
1890
|
+ 7 $"Backup GPG key to USB (master keydrive)"
|
|
1891
|
+ 8 $"Backup GPG key to USB (fragment keydrive)"
|
|
1892
|
+ 9 $"Format a USB drive (LUKS encrypted)"
|
|
1893
|
+ 10 $"Remove backups from a USB drive")
|
|
1894
|
+
|
|
1895
|
+ # shellcheck disable=SC2068
|
|
1896
|
+ selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Backup and Restore" --menu $"Choose an operation, or ESC for main menu:" 19 70 12 "${W[@]}" 3>&2 2>&1 1>&3)
|
|
1897
|
+
|
|
1898
|
+ if [ ! "$selection" ]; then
|
|
1899
|
+ break
|
|
1900
|
+ fi
|
|
1901
|
+
|
|
1902
|
+ case $selection in
|
1907
|
1903
|
1) backup_data;;
|
1908
|
1904
|
2) restore_gpg_key;;
|
1909
|
1905
|
3) restore_data;;
|
|
@@ -1914,36 +1910,29 @@ function menu_backup_restore {
|
1914
|
1910
|
8) create_keydrive_fragment;;
|
1915
|
1911
|
9) format_drive;;
|
1916
|
1912
|
10) remove_backups;;
|
1917
|
|
- 11) rm -f "$data"
|
1918
|
|
- break;;
|
1919
|
1913
|
esac
|
1920
|
|
- rm -f "$data"
|
1921
|
1914
|
done
|
1922
|
1915
|
}
|
1923
|
1916
|
|
1924
|
1917
|
function menu_email {
|
1925
|
1918
|
while true
|
1926
|
1919
|
do
|
1927
|
|
- data=$(mktemp 2>/dev/null)
|
1928
|
|
- dialog --backtitle $"Freedombone Control Panel" \
|
1929
|
|
- --title $"Email Menu" \
|
1930
|
|
- --radiolist $"Choose an operation:" 15 70 8 \
|
1931
|
|
- 1 $"Add a user to a mailing list" off \
|
1932
|
|
- 2 $"Remove a user from a mailing list" off \
|
1933
|
|
- 3 $"Add an email rule" off \
|
1934
|
|
- 4 $"Block/Unblock an email address" off \
|
1935
|
|
- 5 $"Block/Unblock email with subject text" off \
|
1936
|
|
- 6 $"Outgoing Email Proxy" off \
|
1937
|
|
- 7 $"Extra email domains" off \
|
1938
|
|
- 8 $"Back to main menu" on 2> "$data"
|
1939
|
|
- sel=$?
|
1940
|
|
- case $sel in
|
1941
|
|
- 1) rm -f "$data"
|
1942
|
|
- break;;
|
1943
|
|
- 255) rm -f "$data"
|
1944
|
|
- break;;
|
1945
|
|
- esac
|
1946
|
|
- case $(cat "$data") in
|
|
1920
|
+ W=(1 $"Add a user to a mailing list"
|
|
1921
|
+ 2 $"Remove a user from a mailing list"
|
|
1922
|
+ 3 $"Add an email rule"
|
|
1923
|
+ 4 $"Block/Unblock an email address"
|
|
1924
|
+ 5 $"Block/Unblock email with subject text"
|
|
1925
|
+ 6 $"Outgoing Email Proxy"
|
|
1926
|
+ 7 $"Extra email domains")
|
|
1927
|
+
|
|
1928
|
+ # shellcheck disable=SC2068
|
|
1929
|
+ selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Email Menu" --menu $"Choose an operation, or ESC for main menu:" 15 70 8 "${W[@]}" 3>&2 2>&1 1>&3)
|
|
1930
|
+
|
|
1931
|
+ if [ ! "$selection" ]; then
|
|
1932
|
+ break
|
|
1933
|
+ fi
|
|
1934
|
+
|
|
1935
|
+ case $selection in
|
1947
|
1936
|
1) add_to_mailing_list;;
|
1948
|
1937
|
2) remove_user_from_mailing_list;;
|
1949
|
1938
|
3) email_rule;;
|
|
@@ -1951,10 +1940,7 @@ function menu_email {
|
1951
|
1940
|
5) block_unblock_subject;;
|
1952
|
1941
|
6) email_smtp_proxy;;
|
1953
|
1942
|
7) email_extra_domains;;
|
1954
|
|
- 8) rm -f "$data"
|
1955
|
|
- break;;
|
1956
|
1943
|
esac
|
1957
|
|
- rm -f "$data"
|
1958
|
1944
|
done
|
1959
|
1945
|
}
|
1960
|
1946
|
|
|
@@ -2073,66 +2059,52 @@ function domain_blocking_show {
|
2073
|
2059
|
function domain_blocking {
|
2074
|
2060
|
while true
|
2075
|
2061
|
do
|
2076
|
|
- data=$(mktemp 2>/dev/null)
|
2077
|
|
- dialog --backtitle $"Freedombone Control Panel" \
|
2078
|
|
- --title $"Domain or User Blocking" \
|
2079
|
|
- --radiolist $"Choose an operation:" 14 60 6 \
|
2080
|
|
- 1 $"Block a domain or user" off \
|
2081
|
|
- 2 $"Unblock a domain or user" off \
|
2082
|
|
- 3 $"Block an IP address" off \
|
2083
|
|
- 4 $"Unblock an IP address" off \
|
2084
|
|
- 5 $"Show blocked domains and users" off \
|
2085
|
|
- 6 $"Back to main menu" on 2> "$data"
|
2086
|
|
- sel=$?
|
2087
|
|
- case $sel in
|
2088
|
|
- 1) rm -f "$data"
|
2089
|
|
- break;;
|
2090
|
|
- 255) rm -f "$data"
|
2091
|
|
- break;;
|
2092
|
|
- esac
|
2093
|
|
- case $(cat "$data") in
|
|
2062
|
+ W=(1 $"Block a domain or user"
|
|
2063
|
+ 2 $"Unblock a domain or user"
|
|
2064
|
+ 3 $"Block an IP address"
|
|
2065
|
+ 4 $"Unblock an IP address"
|
|
2066
|
+ 5 $"Show blocked domains and users")
|
|
2067
|
+
|
|
2068
|
+ # shellcheck disable=SC2068
|
|
2069
|
+ selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Domain or User Blocking" --menu $"Choose an operation, or ESC for main menu:" 13 70 6 "${W[@]}" 3>&2 2>&1 1>&3)
|
|
2070
|
+
|
|
2071
|
+ if [ ! "$selection" ]; then
|
|
2072
|
+ break
|
|
2073
|
+ fi
|
|
2074
|
+
|
|
2075
|
+ case $selection in
|
2094
|
2076
|
1) domain_blocking_add;;
|
2095
|
2077
|
2) domain_blocking_remove;;
|
2096
|
2078
|
3) ip_blocking_add;;
|
2097
|
2079
|
4) ip_blocking_remove;;
|
2098
|
2080
|
5) domain_blocking_show;;
|
2099
|
|
- 6) rm -f "$data"
|
2100
|
|
- break;;
|
2101
|
2081
|
esac
|
2102
|
|
- rm -f "$data"
|
2103
|
2082
|
done
|
2104
|
2083
|
}
|
2105
|
2084
|
|
2106
|
2085
|
function menu_users {
|
2107
|
2086
|
while true
|
2108
|
2087
|
do
|
2109
|
|
- data=$(mktemp 2>/dev/null)
|
2110
|
|
- dialog --backtitle $"Freedombone Control Panel" \
|
2111
|
|
- --title $"Manage Users" \
|
2112
|
|
- --radiolist $"Choose an operation:" 13 70 6 \
|
2113
|
|
- 1 $"Add a user" off \
|
2114
|
|
- 2 $"Delete a user" off \
|
2115
|
|
- 3 $"Change user password" off \
|
2116
|
|
- 4 $"Change user ssh public key" off \
|
2117
|
|
- 5 $"Reset password tries" off \
|
2118
|
|
- 6 $"Back to main menu" on 2> "$data"
|
2119
|
|
- sel=$?
|
2120
|
|
- case $sel in
|
2121
|
|
- 1) rm -f "$data"
|
2122
|
|
- break;;
|
2123
|
|
- 255) rm -f "$data"
|
2124
|
|
- break;;
|
2125
|
|
- esac
|
2126
|
|
- case $(cat "$data") in
|
|
2088
|
+ W=(1 $"Add a user"
|
|
2089
|
+ 2 $"Delete a user"
|
|
2090
|
+ 3 $"Change user password"
|
|
2091
|
+ 4 $"Change user ssh public key"
|
|
2092
|
+ 5 $"Reset password tries")
|
|
2093
|
+
|
|
2094
|
+ # shellcheck disable=SC2068
|
|
2095
|
+ selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Manage Users" --menu $"Choose an operation, or ESC for main menu:" 13 70 6 "${W[@]}" 3>&2 2>&1 1>&3)
|
|
2096
|
+
|
|
2097
|
+ if [ ! "$selection" ]; then
|
|
2098
|
+ break
|
|
2099
|
+ fi
|
|
2100
|
+
|
|
2101
|
+ case $selection in
|
2127
|
2102
|
1) add_user;;
|
2128
|
2103
|
2) delete_user;;
|
2129
|
2104
|
3) change_password;;
|
2130
|
2105
|
4) change_ssh_public_key;;
|
2131
|
2106
|
5) reset_password_tries;;
|
2132
|
|
- 6) rm -f "$data"
|
2133
|
|
- break;;
|
2134
|
2107
|
esac
|
2135
|
|
- rm -f "$data"
|
2136
|
2108
|
done
|
2137
|
2109
|
}
|
2138
|
2110
|
|
|
@@ -2202,31 +2174,24 @@ function menu_wifi {
|
2202
|
2174
|
fi
|
2203
|
2175
|
fi
|
2204
|
2176
|
|
2205
|
|
- data=$(mktemp 2>/dev/null)
|
2206
|
|
- dialog --backtitle $"Freedombone Control Panel" \
|
2207
|
|
- --title $"Wifi Menu" \
|
2208
|
|
- --radiolist $"${status_str}\\n\\nChoose an operation:" 14 70 6 \
|
2209
|
|
- 1 $"Enable or disable Wifi" off \
|
2210
|
|
- 2 $"Configure wifi networks" off \
|
2211
|
|
- 3 $"Manually edit wifi networks file" off \
|
2212
|
|
- 4 $"Hotspot settings" off \
|
2213
|
|
- 5 $"Exit" on 2> "$data"
|
2214
|
|
- sel=$?
|
2215
|
|
- case $sel in
|
2216
|
|
- 1) rm -f "$data"
|
2217
|
|
- break;;
|
2218
|
|
- 255) rm -f "$data"
|
2219
|
|
- break;;
|
2220
|
|
- esac
|
2221
|
|
- case $(cat "$data") in
|
|
2177
|
+ W=(1 $"Enable or disable Wifi"
|
|
2178
|
+ 2 $"Configure wifi networks"
|
|
2179
|
+ 3 $"Manually edit wifi networks file"
|
|
2180
|
+ 4 $"Hotspot settings")
|
|
2181
|
+
|
|
2182
|
+ # shellcheck disable=SC2068
|
|
2183
|
+ selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Wifi Menu" --menu $"${status_str}\\n\\nChoose an operation, or ESC for main menu:" 14 70 6 "${W[@]}" 3>&2 2>&1 1>&3)
|
|
2184
|
+
|
|
2185
|
+ if [ ! "$selection" ]; then
|
|
2186
|
+ break
|
|
2187
|
+ fi
|
|
2188
|
+
|
|
2189
|
+ case $selection in
|
2222
|
2190
|
1) wifi_enable;;
|
2223
|
2191
|
2) wifi_settings;;
|
2224
|
2192
|
3) wifi_edit_networks;;
|
2225
|
2193
|
4) hotspot_settings;;
|
2226
|
|
- 5) rm -f "$data"
|
2227
|
|
- break;;
|
2228
|
2194
|
esac
|
2229
|
|
- rm -f "$data"
|
2230
|
2195
|
done
|
2231
|
2196
|
}
|
2232
|
2197
|
|
|
@@ -2275,41 +2240,38 @@ function menu_app_settings {
|
2275
|
2240
|
function menu_top_level {
|
2276
|
2241
|
while true
|
2277
|
2242
|
do
|
2278
|
|
- data=$(mktemp 2>/dev/null)
|
2279
|
|
- dialog --backtitle $"Freedombone Control Panel" \
|
2280
|
|
- --title $"Control Panel" \
|
2281
|
|
- --radiolist $"Choose an operation:" 30 70 22 \
|
2282
|
|
- 1 $"About this system" off \
|
2283
|
|
- 2 $"Passwords" off \
|
2284
|
|
- 3 $"Backup and Restore" off \
|
2285
|
|
- 4 $"Show Firewall" off \
|
2286
|
|
- 5 $"Verify Tripwire Code" off \
|
2287
|
|
- 6 $"Reset Tripwire" off \
|
2288
|
|
- 7 $"App Settings" off \
|
2289
|
|
- 8 $"Add/Remove Apps" off \
|
2290
|
|
- 9 $"Logging on/off" off \
|
2291
|
|
- 10 $"Ping enable/disable" off \
|
2292
|
|
- 11 $"Manage Users" off \
|
2293
|
|
- 12 $"Email Menu" off \
|
2294
|
|
- 13 $"Domain or User Blocking" off \
|
2295
|
|
- 14 $"Security Settings" off \
|
2296
|
|
- 15 $"Change the name of this system" off \
|
2297
|
|
- 16 $"Set a static local IP address" off \
|
2298
|
|
- 17 $"Wifi menu" off \
|
2299
|
|
- 18 $"Add Clacks" off \
|
2300
|
|
- 19 $"Check for updates" off \
|
2301
|
|
- 20 $"Power off the system" off \
|
2302
|
|
- 21 $"Restart the system" off \
|
2303
|
|
- 22 $"Exit" on 2> "$data"
|
2304
|
|
- sel=$?
|
2305
|
|
- case $sel in
|
2306
|
|
- 1) rm -f "$data"
|
2307
|
|
- exit 1;;
|
2308
|
|
- 255) rm -f "$data"
|
2309
|
|
- exit 1;;
|
2310
|
|
- esac
|
|
2243
|
+ W=(1 $"About this system"
|
|
2244
|
+ 2 $"Passwords"
|
|
2245
|
+ 3 $"Backup and Restore"
|
|
2246
|
+ 4 $"Show Firewall"
|
|
2247
|
+ 5 $"Verify Tripwire Code"
|
|
2248
|
+ 6 $"Reset Tripwire"
|
|
2249
|
+ 7 $"App Settings"
|
|
2250
|
+ 8 $"Add/Remove Apps"
|
|
2251
|
+ 9 $"Logging on/off"
|
|
2252
|
+ 10 $"Ping enable/disable"
|
|
2253
|
+ 11 $"Manage Users"
|
|
2254
|
+ 12 $"Email Menu"
|
|
2255
|
+ 13 $"Domain or User Blocking"
|
|
2256
|
+ 14 $"Security Settings"
|
|
2257
|
+ 15 $"Change the name of this system"
|
|
2258
|
+ 16 $"Set a static local IP address"
|
|
2259
|
+ 17 $"Wifi menu"
|
|
2260
|
+ 18 $"Add Clacks"
|
|
2261
|
+ 19 $"Check for updates"
|
|
2262
|
+ 20 $"Power off the system"
|
|
2263
|
+ 21 $"Restart the system")
|
|
2264
|
+
|
|
2265
|
+ # shellcheck disable=SC2068
|
|
2266
|
+ selection=$(dialog --backtitle $"Freedombone Administrator Control Panel" --title $"Administrator Control Panel" --menu $"Choose an operation, or ESC to exit:" 28 60 28 "${W[@]}" 3>&2 2>&1 1>&3)
|
|
2267
|
+
|
|
2268
|
+ if [ ! "$selection" ]; then
|
|
2269
|
+ break
|
|
2270
|
+ fi
|
|
2271
|
+
|
2311
|
2272
|
please_wait
|
2312
|
|
- case $(cat "$data") in
|
|
2273
|
+
|
|
2274
|
+ case $selection in
|
2313
|
2275
|
1) show_about;;
|
2314
|
2276
|
2) view_or_change_passwords;;
|
2315
|
2277
|
3) menu_backup_restore;;
|
|
@@ -2335,10 +2297,7 @@ function menu_top_level {
|
2335
|
2297
|
19) check_for_updates;;
|
2336
|
2298
|
20) shut_down_system;;
|
2337
|
2299
|
21) restart_system;;
|
2338
|
|
- 22) rm -f "$data"
|
2339
|
|
- break;;
|
2340
|
2300
|
esac
|
2341
|
|
- rm -f "$data"
|
2342
|
2301
|
done
|
2343
|
2302
|
}
|
2344
|
2303
|
|