Syncthing devices on user control panel

This commit is contained in:
Bob Mottram 2016-04-09 20:51:37 +01:00
parent c83e73fc05
commit ff2e640bde
1 changed files with 27 additions and 11 deletions

View File

@ -616,6 +616,20 @@ function menu_admin {
fi
}
function syncthing_devices {
SYNCTHING_CONFIG_FILE=~/.syncthingids
SYNCTHING_ID=$(cat ~/.syncthing-server-id)
if [ ! -f $SYNCTHING_CONFIG_FILE ]; then
echo $'# Your syncthing configuration file' > $SYNCTHING_CONFIG_FILE
echo '#' >> $SYNCTHING_CONFIG_FILE
echo $"# The ${PROJECT_NAME} syncthing ID is: $SYNCTHING_ID"
echo '#' >> $SYNCTHING_CONFIG_FILE
echo '# Paste the IDs of your devices below' >> $SYNCTHING_CONFIG_FILE
echo '#' >> $SYNCTHING_CONFIG_FILE
fi
editor $SYNCTHING_CONFIG_FILE
}
function menu_top_level {
while true
do
@ -623,18 +637,19 @@ function menu_top_level {
trap "rm -f $data" 0 1 2 5 15
dialog --backtitle $"Freedombone User Control Panel" \
--title $"User Control Panel" \
--radiolist $"Choose an operation:" 18 50 11 \
--radiolist $"Choose an operation:" 19 50 12 \
1 $"Use Email" off \
2 $"Change Email Filtering Rules" off \
3 $"Use Tox Chat" off \
4 $"Use XMPP Chat" off \
5 $"Use IRC" off \
6 $"Browse the Web" off \
7 $"Your Encryption Keys" off \
8 $"Set an outgoing email proxy" off \
9 $"Administrator controls" off \
10 $"Exit to the command line" off \
11 $"Log out" on 2> $data
7 $"Syncthing devices" off \
8 $"Your Encryption Keys" off \
9 $"Set an outgoing email proxy" off \
10 $"Administrator controls" off \
11 $"Exit to the command line" off \
12 $"Log out" on 2> $data
sel=$?
case $sel in
1) exit 1;;
@ -647,11 +662,12 @@ function menu_top_level {
4) torify profanity;;
5) torify irssi;;
6) torify elinks;;
7) menu_encryption_keys;;
8) smtp_proxy;;
9) menu_admin;;
10) break;;
11) kill -HUP `pgrep -s 0 -o`;;
7) syncthing_devices;;
8) menu_encryption_keys;;
9) smtp_proxy;;
10) menu_admin;;
11) break;;
12) kill -HUP `pgrep -s 0 -o`;;
esac
done
}