|
@@ -1696,6 +1696,95 @@ function wifi_settings {
|
1696
|
1696
|
fi
|
1697
|
1697
|
}
|
1698
|
1698
|
|
|
1699
|
+function hotspot_settings {
|
|
1700
|
+ data=$(tempfile 2>/dev/null)
|
|
1701
|
+ trap "rm -f $data" 0 1 2 5 15
|
|
1702
|
+ dialog --backtitle $"Freedombone Control Panel" \
|
|
1703
|
+ --title $"Hotspot Settings" \
|
|
1704
|
+ --form $"" 10 60 4 \
|
|
1705
|
+ $"Enabled (yes/no):" 1 1 "$WIFI_HOTSPOT" 1 24 5 5 \
|
|
1706
|
+ $"SSID:" 2 1 "$WIFI_SSID" 2 24 256 256 \
|
|
1707
|
+ $"Type (wpa2-psk/none):" 3 1 "$WIFI_TYPE" 3 24 10 10 \
|
|
1708
|
+ $"Passphrase:" 4 1 "$WIFI_PASSPHRASE" 4 24 256 256 \
|
|
1709
|
+ 2> $data
|
|
1710
|
+ sel=$?
|
|
1711
|
+ case $sel in
|
|
1712
|
+ 1) return;;
|
|
1713
|
+ 255) return;;
|
|
1714
|
+ esac
|
|
1715
|
+ TEMP_WIFI_HOTSPOT=$(cat $data | sed -n 1p)
|
|
1716
|
+ TEMP_WIFI_SSID=$(cat $data | sed -n 2p)
|
|
1717
|
+ TEMP_WIFI_TYPE=$(cat $data | sed -n 3p)
|
|
1718
|
+ TEMP_WIFI_PASSPHRASE=$(cat $data | sed -n 4p)
|
|
1719
|
+
|
|
1720
|
+ if [ ${#TEMP_WIFI_SSID} -lt 2 ]; then
|
|
1721
|
+ return
|
|
1722
|
+ fi
|
|
1723
|
+ if [ ${#TEMP_WIFI_TYPE} -lt 2 ]; then
|
|
1724
|
+ return
|
|
1725
|
+ fi
|
|
1726
|
+
|
|
1727
|
+ WIFI_EXTRA=''
|
|
1728
|
+ if [[ $TEMP_WIFI_HOTSPOT == $'yes' || $TEMP_WIFI_HOTSPOT == $'y' || $TEMP_WIFI_HOTSPOT == $'on' ]]; then
|
|
1729
|
+ TEMP_WIFI_HOTSPOT='yes'
|
|
1730
|
+ else
|
|
1731
|
+ TEMP_WIFI_HOTSPOT='no'
|
|
1732
|
+ WIFI_EXTRA='--networks $WIFI_NETWORKS_FILE'
|
|
1733
|
+ fi
|
|
1734
|
+
|
|
1735
|
+ if [[ $TEMP_WIFI_TYPE != $'none' ]]; then
|
|
1736
|
+ if [ ! $TEMP_WIFI_PASSPHRASE ]; then
|
|
1737
|
+ dialog --title $"Wifi Settings" \
|
|
1738
|
+ --msgbox $"No wifi hotspot passphrase was given" 6 40
|
|
1739
|
+ return
|
|
1740
|
+ fi
|
|
1741
|
+ if [ ${#TEMP_WIFI_PASSPHRASE} -lt 2 ]; then
|
|
1742
|
+ dialog --title $"Wifi Settings" \
|
|
1743
|
+ --msgbox $"Wifi hotspot passphrase was too short" 6 40
|
|
1744
|
+ return
|
|
1745
|
+ fi
|
|
1746
|
+
|
|
1747
|
+ WIFI_HOTSPOT=$TEMP_WIFI_HOTSPOT
|
|
1748
|
+ WIFI_SSID=$TEMP_WIFI_SSID
|
|
1749
|
+ WIFI_TYPE=$TEMP_WIFI_TYPE
|
|
1750
|
+ WIFI_PASSPHRASE=$TEMP_WIFI_PASSPHRASE
|
|
1751
|
+
|
|
1752
|
+ ${PROJECT_NAME}-wifi -i $WIFI_INTERFACE -s $WIFI_SSID -t $WIFI_TYPE -p $WIFI_PASSPHRASE --hotspot $WIFI_HOTSPOT $WIFI_EXTRA
|
|
1753
|
+ else
|
|
1754
|
+ WIFI_HOTSPOT=$TEMP_WIFI_HOTSPOT
|
|
1755
|
+ WIFI_SSID=$TEMP_WIFI_SSID
|
|
1756
|
+ WIFI_TYPE=$TEMP_WIFI_TYPE
|
|
1757
|
+ WIFI_PASSPHRASE=$TEMP_WIFI_PASSPHRASE
|
|
1758
|
+
|
|
1759
|
+ ${PROJECT_NAME}-wifi -i $WIFI_INTERFACE -s $WIFI_SSID -t $WIFI_TYPE --hotspot $WIFI_HOTSPOT $WIFI_EXTRA
|
|
1760
|
+ fi
|
|
1761
|
+
|
|
1762
|
+ # store any changes
|
|
1763
|
+ if ! grep -q "WIFI_HOTSPOT" $CONFIGURATION_FILE; then
|
|
1764
|
+ echo "WIFI_HOTSPOT=$WIFI_HOTSPOT" >> $CONFIGURATION_FILE
|
|
1765
|
+ else
|
|
1766
|
+ sed -i "s|WIFI_HOTSPOT=.*|WIFI_HOTSPOT=$WIFI_HOTSPOT|g" $CONFIGURATION_FILE
|
|
1767
|
+ fi
|
|
1768
|
+ if ! grep -q "WIFI_SSID" $CONFIGURATION_FILE; then
|
|
1769
|
+ echo "WIFI_SSID=$WIFI_SSID" >> $CONFIGURATION_FILE
|
|
1770
|
+ else
|
|
1771
|
+ sed -i "s|WIFI_SSID=.*|WIFI_SSID=$WIFI_SSID|g" $CONFIGURATION_FILE
|
|
1772
|
+ fi
|
|
1773
|
+ if ! grep -q "WIFI_TYPE" $CONFIGURATION_FILE; then
|
|
1774
|
+ echo "WIFI_TYPE=$WIFI_TYPE" >> $CONFIGURATION_FILE
|
|
1775
|
+ else
|
|
1776
|
+ sed -i "s|WIFI_TYPE=.*|WIFI_SSID=$WIFI_TYPE|g" $CONFIGURATION_FILE
|
|
1777
|
+ fi
|
|
1778
|
+ if ! grep -q "WIFI_PASSPHRASE" $CONFIGURATION_FILE; then
|
|
1779
|
+ echo "WIFI_PASSPHRASE=$WIFI_PASSPHRASE" >> $CONFIGURATION_FILE
|
|
1780
|
+ else
|
|
1781
|
+ sed -i "s|WIFI_PASSPHRASE=.*|WIFI_PASSPHRASE=$WIFI_PASSPHRASE|g" $CONFIGURATION_FILE
|
|
1782
|
+ fi
|
|
1783
|
+
|
|
1784
|
+ dialog --title $"Wifi Settings" \
|
|
1785
|
+ --msgbox $"Hotspot settings were changed" 6 40
|
|
1786
|
+}
|
|
1787
|
+
|
1699
|
1788
|
function menu_backup_restore {
|
1700
|
1789
|
while true
|
1701
|
1790
|
do
|
|
@@ -1781,207 +1870,203 @@ function menu_users {
|
1781
|
1870
|
case $sel in
|
1782
|
1871
|
1) break;;
|
1783
|
1872
|
255) break;;
|
1784
|
|
- esac
|
1785
|
|
- case $(cat $data) in
|
1786
|
|
- 1) add_user;;
|
1787
|
|
- 2) delete_user;;
|
1788
|
|
- 3) change_password;;
|
1789
|
|
- 4) change_ssh_public_key;;
|
1790
|
|
- 5) break;;
|
1791
|
|
- esac
|
1792
|
|
- done
|
1793
|
|
-}
|
1794
|
|
-
|
1795
|
|
-function menu_hubzilla {
|
1796
|
|
- while true
|
1797
|
|
- do
|
1798
|
|
- data=$(tempfile 2>/dev/null)
|
1799
|
|
- trap "rm -f $data" 0 1 2 5 15
|
1800
|
|
- dialog --backtitle $"Freedombone Control Panel" \
|
1801
|
|
- --title $"Hubzilla" \
|
1802
|
|
- --radiolist $"Choose an operation:" 13 70 4 \
|
1803
|
|
- 1 $"Set channel directory server" off \
|
1804
|
|
- 2 $"Renew SSL certificate" off \
|
1805
|
|
- 3 $"Back to main menu" on 2> $data
|
1806
|
|
- sel=$?
|
1807
|
|
- case $sel in
|
1808
|
|
- 1) break;;
|
1809
|
|
- 255) break;;
|
1810
|
|
- esac
|
1811
|
|
- case $(cat $data) in
|
1812
|
|
- 1) hubzilla_channel_directory_server;;
|
1813
|
|
- 2) hubzilla_renew_cert;;
|
1814
|
|
- 3) break;;
|
1815
|
|
- esac
|
1816
|
|
- done
|
1817
|
|
-}
|
1818
|
|
-
|
1819
|
|
-function menu_media {
|
1820
|
|
- while true
|
1821
|
|
- do
|
1822
|
|
- data=$(tempfile 2>/dev/null)
|
1823
|
|
- trap "rm -f $data" 0 1 2 5 15
|
1824
|
|
- dialog --backtitle $"Freedombone Control Panel" \
|
1825
|
|
- --title $"Media Menu" \
|
1826
|
|
- --radiolist $"Choose an operation:" 13 70 3 \
|
1827
|
|
- 1 $"Attach a drive containing playable media" off \
|
1828
|
|
- 2 $"Remove a drive containing playable media" off \
|
1829
|
|
- 3 $"Exit" on 2> $data
|
1830
|
|
- sel=$?
|
1831
|
|
- case $sel in
|
1832
|
|
- 1) break;;
|
1833
|
|
- 255) break;;
|
1834
|
|
- esac
|
1835
|
|
- case $(cat $data) in
|
1836
|
|
- 1) remove-music
|
1837
|
|
- attach-music;;
|
1838
|
|
- 2) remove-music;;
|
1839
|
|
- 3) break;;
|
1840
|
|
- esac
|
1841
|
|
- done
|
1842
|
|
-}
|
1843
|
|
-
|
1844
|
|
-function hotspot_settings {
|
1845
|
|
- # TODO
|
1846
|
|
-}
|
1847
|
|
-
|
1848
|
|
-function menu_wifi {
|
1849
|
|
- hotspot_state=$'off'
|
1850
|
|
- if [ -f /etc/hostapd/hostapd.conf ]; then
|
1851
|
|
- hotspot_state=$'on'
|
1852
|
|
- fi
|
1853
|
|
-
|
1854
|
|
- while true
|
1855
|
|
- do
|
1856
|
|
- data=$(tempfile 2>/dev/null)
|
1857
|
|
- trap "rm -f $data" 0 1 2 5 15
|
1858
|
|
- dialog --backtitle $"Freedombone Control Panel" \
|
1859
|
|
- --title $"Wifi Menu" \
|
1860
|
|
- --radiolist $"Choose an operation:" 12 70 4 \
|
1861
|
|
- 1 $"Configure wifi networks" off \
|
1862
|
|
- 2 $"Manually edit wifi networks file" off \
|
1863
|
|
- 3 $"Hotspot settings" off \
|
1864
|
|
- 4 $"Exit" on 2> $data
|
1865
|
|
- sel=$?
|
1866
|
|
- case $sel in
|
1867
|
|
- 1) break;;
|
1868
|
|
- 255) break;;
|
1869
|
|
- esac
|
1870
|
|
- case $(cat $data) in
|
1871
|
|
- 1) wifi_settings;;
|
1872
|
|
- 2) editor $WIFI_NETWORKS_FILE;;
|
1873
|
|
- 3) hotspot_settings;;
|
1874
|
|
- 4) break;;
|
1875
|
|
- esac
|
1876
|
|
- done
|
|
1873
|
+esac
|
|
1874
|
+case $(cat $data) in
|
|
1875
|
+ 1) add_user;;
|
|
1876
|
+ 2) delete_user;;
|
|
1877
|
+ 3) change_password;;
|
|
1878
|
+ 4) change_ssh_public_key;;
|
|
1879
|
+ 5) break;;
|
|
1880
|
+esac
|
|
1881
|
+done
|
1877
|
1882
|
}
|
1878
|
1883
|
|
1879
|
|
-function menu_irc {
|
1880
|
|
- if [ ! -d /etc/ngircd ]; then
|
1881
|
|
- dialog --title $"IRC Menu" \
|
1882
|
|
- --msgbox $"No IRC server is installed" 6 70
|
1883
|
|
- return
|
1884
|
|
- fi
|
1885
|
|
-
|
1886
|
|
- while true
|
1887
|
|
- do
|
1888
|
|
- data=$(tempfile 2>/dev/null)
|
1889
|
|
- trap "rm -f $data" 0 1 2 5 15
|
1890
|
|
- dialog --backtitle $"Freedombone Control Panel" \
|
1891
|
|
- --title $"IRC Menu" \
|
1892
|
|
- --radiolist $"Choose an operation:" 14 70 4 \
|
1893
|
|
- 1 $"Set a password for all IRC users" off \
|
1894
|
|
- 2 $"Show current IRC login password" off \
|
1895
|
|
- 3 $"Exit" on 2> $data
|
1896
|
|
- sel=$?
|
1897
|
|
- case $sel in
|
1898
|
|
- 1) break;;
|
1899
|
|
- 255) break;;
|
1900
|
|
- esac
|
1901
|
|
- case $(cat $data) in
|
1902
|
|
- 1) irc_set_global_password;;
|
1903
|
|
- 2) irc_show_password;;
|
1904
|
|
- 3) break;;
|
1905
|
|
- esac
|
1906
|
|
- done
|
1907
|
|
-}
|
1908
|
|
-
|
1909
|
|
-function menu_top_level {
|
1910
|
|
- while true
|
1911
|
|
- do
|
1912
|
|
- data=$(tempfile 2>/dev/null)
|
1913
|
|
- trap "rm -f $data" 0 1 2 5 15
|
1914
|
|
- dialog --backtitle $"Freedombone Control Panel" \
|
1915
|
|
- --title $"Control Panel" \
|
1916
|
|
- --radiolist $"Choose an operation:" 29 70 22 \
|
1917
|
|
- 1 $"About this system" off \
|
1918
|
|
- 2 $"Backup and Restore" off \
|
1919
|
|
- 3 $"Reset Tripwire" off \
|
1920
|
|
- 4 $"Logging on/off" off \
|
1921
|
|
- 5 $"Ping enable/disable" off \
|
1922
|
|
- 6 $"Manage Users" off \
|
1923
|
|
- 7 $"Email Filtering Rules" off \
|
1924
|
|
- 8 $"Outgoing Email Proxy" off \
|
1925
|
|
- 9 $"Security Settings" off \
|
1926
|
|
- 10 $"Set the main repository (repo mirrors)" off \
|
1927
|
|
- 11 $"Hubzilla" off \
|
1928
|
|
- 12 $"Media menu" off \
|
1929
|
|
- 13 $"IRC menu" off \
|
1930
|
|
- 14 $"Change your blog avatar" off \
|
1931
|
|
- 15 $"Change the name of this system" off \
|
1932
|
|
- 16 $"Set the TLS date/time source" off \
|
1933
|
|
- 17 $"Set a static local IP address" off \
|
1934
|
|
- 18 $"Wifi menu" off \
|
1935
|
|
- 19 $"Check for updates" off \
|
1936
|
|
- 20 $"Power off the system" off \
|
1937
|
|
- 21 $"Restart the system" off \
|
1938
|
|
- 22 $"Exit" on 2> $data
|
1939
|
|
- sel=$?
|
1940
|
|
- case $sel in
|
1941
|
|
- 1) exit 1;;
|
1942
|
|
- 255) exit 1;;
|
1943
|
|
- esac
|
1944
|
|
- case $(cat $data) in
|
1945
|
|
- 1) show_about;;
|
1946
|
|
- 2) menu_backup_restore;;
|
1947
|
|
- 3) reset_tripwire;;
|
1948
|
|
- 4) logging_on_off;;
|
1949
|
|
- 5) ping_enable_disable;;
|
1950
|
|
- 6) menu_users;;
|
1951
|
|
- 7) menu_email;;
|
1952
|
|
- 8) smtp_proxy;;
|
1953
|
|
- 9) security_settings;;
|
1954
|
|
- 10) set_main_repo;;
|
1955
|
|
- 11) menu_hubzilla;;
|
1956
|
|
- 12) menu_media;;
|
1957
|
|
- 13) menu_irc;;
|
1958
|
|
- 14) change_blog_avatar;;
|
1959
|
|
- 15) change_system_name;;
|
1960
|
|
- 16) set_tls_time_source;;
|
1961
|
|
- 17) set_static_IP;;
|
1962
|
|
- 18) menu_wifi;;
|
1963
|
|
- 19) check_for_updates;;
|
1964
|
|
- 20) shut_down_system;;
|
1965
|
|
- 21) restart_system;;
|
1966
|
|
- 22) break;;
|
1967
|
|
- esac
|
1968
|
|
- done
|
1969
|
|
-}
|
1970
|
|
-
|
1971
|
|
-if [[ $USER != 'root' ]]; then
|
1972
|
|
- # show the user version of the control panel
|
1973
|
|
- freedombone-controlpanel-user
|
1974
|
|
- exit 0
|
1975
|
|
-fi
|
1976
|
|
-
|
1977
|
|
-if [ ! -f $COMPLETION_FILE ]; then
|
1978
|
|
- echo $'This command should only be run on an installed Freedombone system'
|
1979
|
|
- exit 1
|
1980
|
|
-fi
|
1981
|
|
-
|
1982
|
|
-ADMIN_USER=$(cat $COMPLETION_FILE | grep "Admin user" | awk -F ':' '{print $2}')
|
1983
|
|
-read_repo_servers
|
1984
|
|
-menu_top_level
|
1985
|
|
-clear
|
1986
|
|
-cat /etc/motd
|
1987
|
|
-exit 0
|
|
1884
|
+ function menu_hubzilla {
|
|
1885
|
+ while true
|
|
1886
|
+ do
|
|
1887
|
+ data=$(tempfile 2>/dev/null)
|
|
1888
|
+ trap "rm -f $data" 0 1 2 5 15
|
|
1889
|
+ dialog --backtitle $"Freedombone Control Panel" \
|
|
1890
|
+ --title $"Hubzilla" \
|
|
1891
|
+ --radiolist $"Choose an operation:" 13 70 4 \
|
|
1892
|
+ 1 $"Set channel directory server" off \
|
|
1893
|
+ 2 $"Renew SSL certificate" off \
|
|
1894
|
+ 3 $"Back to main menu" on 2> $data
|
|
1895
|
+ sel=$?
|
|
1896
|
+ case $sel in
|
|
1897
|
+ 1) break;;
|
|
1898
|
+ 255) break;;
|
|
1899
|
+ esac
|
|
1900
|
+ case $(cat $data) in
|
|
1901
|
+ 1) hubzilla_channel_directory_server;;
|
|
1902
|
+ 2) hubzilla_renew_cert;;
|
|
1903
|
+ 3) break;;
|
|
1904
|
+ esac
|
|
1905
|
+ done
|
|
1906
|
+ }
|
|
1907
|
+
|
|
1908
|
+ function menu_media {
|
|
1909
|
+ while true
|
|
1910
|
+ do
|
|
1911
|
+ data=$(tempfile 2>/dev/null)
|
|
1912
|
+ trap "rm -f $data" 0 1 2 5 15
|
|
1913
|
+ dialog --backtitle $"Freedombone Control Panel" \
|
|
1914
|
+ --title $"Media Menu" \
|
|
1915
|
+ --radiolist $"Choose an operation:" 13 70 3 \
|
|
1916
|
+ 1 $"Attach a drive containing playable media" off \
|
|
1917
|
+ 2 $"Remove a drive containing playable media" off \
|
|
1918
|
+ 3 $"Exit" on 2> $data
|
|
1919
|
+ sel=$?
|
|
1920
|
+ case $sel in
|
|
1921
|
+ 1) break;;
|
|
1922
|
+ 255) break;;
|
|
1923
|
+ esac
|
|
1924
|
+ case $(cat $data) in
|
|
1925
|
+ 1) remove-music
|
|
1926
|
+ attach-music;;
|
|
1927
|
+ 2) remove-music;;
|
|
1928
|
+ 3) break;;
|
|
1929
|
+ esac
|
|
1930
|
+ done
|
|
1931
|
+ }
|
|
1932
|
+
|
|
1933
|
+ function menu_wifi {
|
|
1934
|
+ hotspot_state=$'off'
|
|
1935
|
+ if [ -f /etc/hostapd/hostapd.conf ]; then
|
|
1936
|
+ hotspot_state=$'on'
|
|
1937
|
+ fi
|
|
1938
|
+
|
|
1939
|
+ while true
|
|
1940
|
+ do
|
|
1941
|
+ data=$(tempfile 2>/dev/null)
|
|
1942
|
+ trap "rm -f $data" 0 1 2 5 15
|
|
1943
|
+ dialog --backtitle $"Freedombone Control Panel" \
|
|
1944
|
+ --title $"Wifi Menu" \
|
|
1945
|
+ --radiolist $"Choose an operation:" 12 70 4 \
|
|
1946
|
+ 1 $"Configure wifi networks" off \
|
|
1947
|
+ 2 $"Manually edit wifi networks file" off \
|
|
1948
|
+ 3 $"Hotspot settings" off \
|
|
1949
|
+ 4 $"Exit" on 2> $data
|
|
1950
|
+ sel=$?
|
|
1951
|
+ case $sel in
|
|
1952
|
+ 1) break;;
|
|
1953
|
+ 255) break;;
|
|
1954
|
+ esac
|
|
1955
|
+ case $(cat $data) in
|
|
1956
|
+ 1) wifi_settings;;
|
|
1957
|
+ 2) editor $WIFI_NETWORKS_FILE;;
|
|
1958
|
+ 3) hotspot_settings;;
|
|
1959
|
+ 4) break;;
|
|
1960
|
+ esac
|
|
1961
|
+ done
|
|
1962
|
+ }
|
|
1963
|
+
|
|
1964
|
+ function menu_irc {
|
|
1965
|
+ if [ ! -d /etc/ngircd ]; then
|
|
1966
|
+ dialog --title $"IRC Menu" \
|
|
1967
|
+ --msgbox $"No IRC server is installed" 6 70
|
|
1968
|
+ return
|
|
1969
|
+ fi
|
|
1970
|
+
|
|
1971
|
+ while true
|
|
1972
|
+ do
|
|
1973
|
+ data=$(tempfile 2>/dev/null)
|
|
1974
|
+ trap "rm -f $data" 0 1 2 5 15
|
|
1975
|
+ dialog --backtitle $"Freedombone Control Panel" \
|
|
1976
|
+ --title $"IRC Menu" \
|
|
1977
|
+ --radiolist $"Choose an operation:" 14 70 4 \
|
|
1978
|
+ 1 $"Set a password for all IRC users" off \
|
|
1979
|
+ 2 $"Show current IRC login password" off \
|
|
1980
|
+ 3 $"Exit" on 2> $data
|
|
1981
|
+ sel=$?
|
|
1982
|
+ case $sel in
|
|
1983
|
+ 1) break;;
|
|
1984
|
+ 255) break;;
|
|
1985
|
+ esac
|
|
1986
|
+ case $(cat $data) in
|
|
1987
|
+ 1) irc_set_global_password;;
|
|
1988
|
+ 2) irc_show_password;;
|
|
1989
|
+ 3) break;;
|
|
1990
|
+ esac
|
|
1991
|
+ done
|
|
1992
|
+ }
|
|
1993
|
+
|
|
1994
|
+ function menu_top_level {
|
|
1995
|
+ while true
|
|
1996
|
+ do
|
|
1997
|
+ data=$(tempfile 2>/dev/null)
|
|
1998
|
+ trap "rm -f $data" 0 1 2 5 15
|
|
1999
|
+ dialog --backtitle $"Freedombone Control Panel" \
|
|
2000
|
+ --title $"Control Panel" \
|
|
2001
|
+ --radiolist $"Choose an operation:" 29 70 22 \
|
|
2002
|
+ 1 $"About this system" off \
|
|
2003
|
+ 2 $"Backup and Restore" off \
|
|
2004
|
+ 3 $"Reset Tripwire" off \
|
|
2005
|
+ 4 $"Logging on/off" off \
|
|
2006
|
+ 5 $"Ping enable/disable" off \
|
|
2007
|
+ 6 $"Manage Users" off \
|
|
2008
|
+ 7 $"Email Filtering Rules" off \
|
|
2009
|
+ 8 $"Outgoing Email Proxy" off \
|
|
2010
|
+ 9 $"Security Settings" off \
|
|
2011
|
+ 10 $"Set the main repository (repo mirrors)" off \
|
|
2012
|
+ 11 $"Hubzilla" off \
|
|
2013
|
+ 12 $"Media menu" off \
|
|
2014
|
+ 13 $"IRC menu" off \
|
|
2015
|
+ 14 $"Change your blog avatar" off \
|
|
2016
|
+ 15 $"Change the name of this system" off \
|
|
2017
|
+ 16 $"Set the TLS date/time source" off \
|
|
2018
|
+ 17 $"Set a static local IP address" off \
|
|
2019
|
+ 18 $"Wifi menu" off \
|
|
2020
|
+ 19 $"Check for updates" off \
|
|
2021
|
+ 20 $"Power off the system" off \
|
|
2022
|
+ 21 $"Restart the system" off \
|
|
2023
|
+ 22 $"Exit" on 2> $data
|
|
2024
|
+ sel=$?
|
|
2025
|
+ case $sel in
|
|
2026
|
+ 1) exit 1;;
|
|
2027
|
+ 255) exit 1;;
|
|
2028
|
+ esac
|
|
2029
|
+ case $(cat $data) in
|
|
2030
|
+ 1) show_about;;
|
|
2031
|
+ 2) menu_backup_restore;;
|
|
2032
|
+ 3) reset_tripwire;;
|
|
2033
|
+ 4) logging_on_off;;
|
|
2034
|
+ 5) ping_enable_disable;;
|
|
2035
|
+ 6) menu_users;;
|
|
2036
|
+ 7) menu_email;;
|
|
2037
|
+ 8) smtp_proxy;;
|
|
2038
|
+ 9) security_settings;;
|
|
2039
|
+ 10) set_main_repo;;
|
|
2040
|
+ 11) menu_hubzilla;;
|
|
2041
|
+ 12) menu_media;;
|
|
2042
|
+ 13) menu_irc;;
|
|
2043
|
+ 14) change_blog_avatar;;
|
|
2044
|
+ 15) change_system_name;;
|
|
2045
|
+ 16) set_tls_time_source;;
|
|
2046
|
+ 17) set_static_IP;;
|
|
2047
|
+ 18) menu_wifi;;
|
|
2048
|
+ 19) check_for_updates;;
|
|
2049
|
+ 20) shut_down_system;;
|
|
2050
|
+ 21) restart_system;;
|
|
2051
|
+ 22) break;;
|
|
2052
|
+ esac
|
|
2053
|
+ done
|
|
2054
|
+ }
|
|
2055
|
+
|
|
2056
|
+ if [[ $USER != 'root' ]]; then
|
|
2057
|
+ # show the user version of the control panel
|
|
2058
|
+ freedombone-controlpanel-user
|
|
2059
|
+ exit 0
|
|
2060
|
+ fi
|
|
2061
|
+
|
|
2062
|
+ if [ ! -f $COMPLETION_FILE ]; then
|
|
2063
|
+ echo $'This command should only be run on an installed Freedombone system'
|
|
2064
|
+ exit 1
|
|
2065
|
+ fi
|
|
2066
|
+
|
|
2067
|
+ ADMIN_USER=$(cat $COMPLETION_FILE | grep "Admin user" | awk -F ':' '{print $2}')
|
|
2068
|
+ read_repo_servers
|
|
2069
|
+ menu_top_level
|
|
2070
|
+ clear
|
|
2071
|
+ cat /etc/motd
|
|
2072
|
+ exit 0
|