Assign a name to mesh peers

This commit is contained in:
Bob Mottram 2015-07-27 21:29:12 +01:00
parent 95d20e1597
commit 183c1fb093
1 changed files with 22 additions and 11 deletions

View File

@ -550,6 +550,17 @@ function interactive_configuration {
1) exit 1;; 1) exit 1;;
255) exit 1;; 255) exit 1;;
esac esac
data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15
dialog --backtitle "Freedombone Configuration" \
--inputbox "Give your mesh peer a name" 10 40 "$(grep 'DEFAULT_DOMAIN_NAME' temp.cfg | awk -F '=' '{print $2}')" 2> $data
sel=$?
case $sel in
0) ESSID=$(cat $data);;
1) exit 1;;
255) exit 1;;
esac
fi fi
if [[ $ENABLE_BATMAN == "yes" ]]; then if [[ $ENABLE_BATMAN == "yes" ]]; then
@ -938,17 +949,17 @@ function interactive_configuration {
while [ ! $MY_NAME ] while [ ! $MY_NAME ]
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 Configuration" \ dialog --backtitle "Freedombone Configuration" \
--inputbox "Your full name (or nick)" 10 30 "$(grep 'MY_NAME' temp.cfg | awk -F '=' '{print $2}')" 2> $data --inputbox "Your full name (or nick)" 10 30 "$(grep 'MY_NAME' temp.cfg | awk -F '=' '{print $2}')" 2> $data
sel=$? sel=$?
case $sel in case $sel in
0) MY_NAME=$(cat $data);; 0) MY_NAME=$(cat $data);;
1) exit 1;; 1) exit 1;;
255) exit 1;; 255) exit 1;;
esac esac
done done
save_configuration_file save_configuration_file
fi fi
if [ ! $LOCAL_NETWORK_STATIC_IP_ADDRESS ]; then if [ ! $LOCAL_NETWORK_STATIC_IP_ADDRESS ]; then