Skip to content
Snippets Groups Projects
Commit c7d16657 authored by Bob Mottram's avatar Bob Mottram
Browse files

New style syncthing menu

parent 6781dba0
No related branches found
No related tags found
No related merge requests found
......@@ -213,33 +213,26 @@ function run_client_syncthing {
SYNCTHING_CONFIG_FILE=~/.syncthingids
SYNCTHING_ID=$(cat ~/.syncthing-server-id)
W=(1 $"Show device ID for ${PROJECT_NAME}"
2 $"Add an ID for another machine or device"
3 $"Remove an ID for another machine or device"
4 $"Manually edit device IDs")
while true
do
data=$(mktemp 2>/dev/null)
dialog --backtitle $"Freedombone User Control Panel" \
--title $"File Synchronization" \
--radiolist $"Choose an operation:" 12 70 6 \
1 $"Show device ID for ${PROJECT_NAME}" off \
2 $"Add an ID for another machine or device" off \
3 $"Remove an ID for another machine or device" off \
4 $"Manually edit device IDs" off \
5 $"Back to main menu" on 2> "$data"
sel=$?
case $sel in
1) rm -f "$data"
break;;
255) rm -f "$data"
break;;
esac
case $(cat "$data") in
# shellcheck disable=SC2068
selection=$(dialog --backtitle $"Freedombone User Control Panel" --title $"File Synchronization" --menu $"Choose an operation, or ESC for main menu:" 12 70 6 "${W[@]}" 3>&2 2>&1 1>&3)
if [ ! "$selection" ]; then
break
fi
case $selection in
1) syncthing_show_id;;
2) syncthing_add_id;;
3) syncthing_remove_id;;
4) syncthing_manual_edit;;
5) rm -f "$data"
break;;
esac
rm -f "$data"
done
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment