This commit is contained in:
Bob Mottram 2016-04-27 12:26:34 +01:00
parent d02d8701de
commit 53f105e4eb
No known key found for this signature in database
GPG Key ID: BA68F26108DC9F87
1 changed files with 191 additions and 191 deletions

View File

@ -1870,203 +1870,203 @@ function menu_users {
case $sel in case $sel in
1) break;; 1) break;;
255) break;; 255) break;;
esac esac
case $(cat $data) in case $(cat $data) in
1) add_user;; 1) add_user;;
2) delete_user;; 2) delete_user;;
3) change_password;; 3) change_password;;
4) change_ssh_public_key;; 4) change_ssh_public_key;;
5) break;; 5) break;;
esac esac
done done
} }
function menu_hubzilla { function menu_hubzilla {
while true while true
do do
data=$(tempfile 2>/dev/null) data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15 trap "rm -f $data" 0 1 2 5 15
dialog --backtitle $"Freedombone Control Panel" \ dialog --backtitle $"Freedombone Control Panel" \
--title $"Hubzilla" \ --title $"Hubzilla" \
--radiolist $"Choose an operation:" 13 70 4 \ --radiolist $"Choose an operation:" 13 70 4 \
1 $"Set channel directory server" off \ 1 $"Set channel directory server" off \
2 $"Renew SSL certificate" off \ 2 $"Renew SSL certificate" off \
3 $"Back to main menu" on 2> $data 3 $"Back to main menu" on 2> $data
sel=$? sel=$?
case $sel in case $sel in
1) break;; 1) break;;
255) break;; 255) break;;
esac esac
case $(cat $data) in case $(cat $data) in
1) hubzilla_channel_directory_server;; 1) hubzilla_channel_directory_server;;
2) hubzilla_renew_cert;; 2) hubzilla_renew_cert;;
3) break;; 3) break;;
esac esac
done done
} }
function menu_media { function menu_media {
while true while true
do do
data=$(tempfile 2>/dev/null) data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15 trap "rm -f $data" 0 1 2 5 15
dialog --backtitle $"Freedombone Control Panel" \ dialog --backtitle $"Freedombone Control Panel" \
--title $"Media Menu" \ --title $"Media Menu" \
--radiolist $"Choose an operation:" 13 70 3 \ --radiolist $"Choose an operation:" 13 70 3 \
1 $"Attach a drive containing playable media" off \ 1 $"Attach a drive containing playable media" off \
2 $"Remove a drive containing playable media" off \ 2 $"Remove a drive containing playable media" off \
3 $"Exit" on 2> $data 3 $"Exit" on 2> $data
sel=$? sel=$?
case $sel in case $sel in
1) break;; 1) break;;
255) break;; 255) break;;
esac esac
case $(cat $data) in case $(cat $data) in
1) remove-music 1) remove-music
attach-music;; attach-music;;
2) remove-music;; 2) remove-music;;
3) break;; 3) break;;
esac esac
done done
} }
function menu_wifi { function menu_wifi {
hotspot_state=$'off' hotspot_state=$'off'
if [ -f /etc/hostapd/hostapd.conf ]; then if [ -f /etc/hostapd/hostapd.conf ]; then
hotspot_state=$'on' hotspot_state=$'on'
fi fi
while true while true
do do
data=$(tempfile 2>/dev/null) data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15 trap "rm -f $data" 0 1 2 5 15
dialog --backtitle $"Freedombone Control Panel" \ dialog --backtitle $"Freedombone Control Panel" \
--title $"Wifi Menu" \ --title $"Wifi Menu" \
--radiolist $"Choose an operation:" 12 70 4 \ --radiolist $"Choose an operation:" 12 70 4 \
1 $"Configure wifi networks" off \ 1 $"Configure wifi networks" off \
2 $"Manually edit wifi networks file" off \ 2 $"Manually edit wifi networks file" off \
3 $"Hotspot settings" off \ 3 $"Hotspot settings" off \
4 $"Exit" on 2> $data 4 $"Exit" on 2> $data
sel=$? sel=$?
case $sel in case $sel in
1) break;; 1) break;;
255) break;; 255) break;;
esac esac
case $(cat $data) in case $(cat $data) in
1) wifi_settings;; 1) wifi_settings;;
2) editor $WIFI_NETWORKS_FILE;; 2) editor $WIFI_NETWORKS_FILE;;
3) hotspot_settings;; 3) hotspot_settings;;
4) break;; 4) break;;
esac esac
done done
} }
function menu_irc { function menu_irc {
if [ ! -d /etc/ngircd ]; then if [ ! -d /etc/ngircd ]; then
dialog --title $"IRC Menu" \ dialog --title $"IRC Menu" \
--msgbox $"No IRC server is installed" 6 70 --msgbox $"No IRC server is installed" 6 70
return return
fi fi
while true while true
do do
data=$(tempfile 2>/dev/null) data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15 trap "rm -f $data" 0 1 2 5 15
dialog --backtitle $"Freedombone Control Panel" \ dialog --backtitle $"Freedombone Control Panel" \
--title $"IRC Menu" \ --title $"IRC Menu" \
--radiolist $"Choose an operation:" 14 70 4 \ --radiolist $"Choose an operation:" 14 70 4 \
1 $"Set a password for all IRC users" off \ 1 $"Set a password for all IRC users" off \
2 $"Show current IRC login password" off \ 2 $"Show current IRC login password" off \
3 $"Exit" on 2> $data 3 $"Exit" on 2> $data
sel=$? sel=$?
case $sel in case $sel in
1) break;; 1) break;;
255) break;; 255) break;;
esac esac
case $(cat $data) in case $(cat $data) in
1) irc_set_global_password;; 1) irc_set_global_password;;
2) irc_show_password;; 2) irc_show_password;;
3) break;; 3) break;;
esac esac
done done
} }
function menu_top_level { function menu_top_level {
while true while true
do do
data=$(tempfile 2>/dev/null) data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15 trap "rm -f $data" 0 1 2 5 15
dialog --backtitle $"Freedombone Control Panel" \ dialog --backtitle $"Freedombone Control Panel" \
--title $"Control Panel" \ --title $"Control Panel" \
--radiolist $"Choose an operation:" 29 70 22 \ --radiolist $"Choose an operation:" 29 70 22 \
1 $"About this system" off \ 1 $"About this system" off \
2 $"Backup and Restore" off \ 2 $"Backup and Restore" off \
3 $"Reset Tripwire" off \ 3 $"Reset Tripwire" off \
4 $"Logging on/off" off \ 4 $"Logging on/off" off \
5 $"Ping enable/disable" off \ 5 $"Ping enable/disable" off \
6 $"Manage Users" off \ 6 $"Manage Users" off \
7 $"Email Filtering Rules" off \ 7 $"Email Filtering Rules" off \
8 $"Outgoing Email Proxy" off \ 8 $"Outgoing Email Proxy" off \
9 $"Security Settings" off \ 9 $"Security Settings" off \
10 $"Set the main repository (repo mirrors)" off \ 10 $"Set the main repository (repo mirrors)" off \
11 $"Hubzilla" off \ 11 $"Hubzilla" off \
12 $"Media menu" off \ 12 $"Media menu" off \
13 $"IRC menu" off \ 13 $"IRC menu" off \
14 $"Change your blog avatar" off \ 14 $"Change your blog avatar" off \
15 $"Change the name of this system" off \ 15 $"Change the name of this system" off \
16 $"Set the TLS date/time source" off \ 16 $"Set the TLS date/time source" off \
17 $"Set a static local IP address" off \ 17 $"Set a static local IP address" off \
18 $"Wifi menu" off \ 18 $"Wifi menu" off \
19 $"Check for updates" off \ 19 $"Check for updates" off \
20 $"Power off the system" off \ 20 $"Power off the system" off \
21 $"Restart the system" off \ 21 $"Restart the system" off \
22 $"Exit" on 2> $data 22 $"Exit" on 2> $data
sel=$? sel=$?
case $sel in case $sel in
1) exit 1;; 1) exit 1;;
255) exit 1;; 255) exit 1;;
esac esac
case $(cat $data) in case $(cat $data) in
1) show_about;; 1) show_about;;
2) menu_backup_restore;; 2) menu_backup_restore;;
3) reset_tripwire;; 3) reset_tripwire;;
4) logging_on_off;; 4) logging_on_off;;
5) ping_enable_disable;; 5) ping_enable_disable;;
6) menu_users;; 6) menu_users;;
7) menu_email;; 7) menu_email;;
8) smtp_proxy;; 8) smtp_proxy;;
9) security_settings;; 9) security_settings;;
10) set_main_repo;; 10) set_main_repo;;
11) menu_hubzilla;; 11) menu_hubzilla;;
12) menu_media;; 12) menu_media;;
13) menu_irc;; 13) menu_irc;;
14) change_blog_avatar;; 14) change_blog_avatar;;
15) change_system_name;; 15) change_system_name;;
16) set_tls_time_source;; 16) set_tls_time_source;;
17) set_static_IP;; 17) set_static_IP;;
18) menu_wifi;; 18) menu_wifi;;
19) check_for_updates;; 19) check_for_updates;;
20) shut_down_system;; 20) shut_down_system;;
21) restart_system;; 21) restart_system;;
22) break;; 22) break;;
esac esac
done done
} }
if [[ $USER != 'root' ]]; then if [[ $USER != 'root' ]]; then
# show the user version of the control panel # show the user version of the control panel
freedombone-controlpanel-user freedombone-controlpanel-user
exit 0 exit 0
fi fi
if [ ! -f $COMPLETION_FILE ]; then if [ ! -f $COMPLETION_FILE ]; then
echo $'This command should only be run on an installed Freedombone system' echo $'This command should only be run on an installed Freedombone system'
exit 1 exit 1
fi fi
ADMIN_USER=$(cat $COMPLETION_FILE | grep "Admin user" | awk -F ':' '{print $2}') ADMIN_USER=$(cat $COMPLETION_FILE | grep "Admin user" | awk -F ':' '{print $2}')
read_repo_servers read_repo_servers
menu_top_level menu_top_level
clear clear
cat /etc/motd cat /etc/motd
exit 0 exit 0