From 5500975b5e84f9d7b1e2a6d7880a2e8adc29fbe7 Mon Sep 17 00:00:00 2001 From: kc2vrj Date: Wed, 29 Jun 2016 00:09:07 -0400 Subject: [PATCH] Create mmdvmmenu.sh This is a simple menu for editing the Config.c in the MMDVM --- mmdvmmenu.sh | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 mmdvmmenu.sh diff --git a/mmdvmmenu.sh b/mmdvmmenu.sh new file mode 100644 index 0000000..390919b --- /dev/null +++ b/mmdvmmenu.sh @@ -0,0 +1,84 @@ +#! /bin/bash + +############################################################################### +# +# mmdvmmenu.sh +# +# Copyright (C) 2016 by Paul Nannery KC2VRJ +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +############################################################################### +# +# On a Linux based system, such as a Raspberry Pi, this script will perform +# Modafacation to the Config.c file for most options. It makes a Back up when +# you staet the script if none is present. You must recompile and load firmwhare +# on Due if changes are made. +# +############################################################################### +# +# CONFIGURATION +# +# Location of Config.h +conf=Config.h +#Location of backup file +confbak=Config.h.bak + +################################################################################ +# +# Do not edit below here +# +############################################################################### + + + +# Check for backup file and make one if not present + +if [ ! -f $confbak ];then + +cp -f $conf $confbak + +fi + +while : +do + clear + cat< $conf.tmp && mv -f $conf.tmp $conf && echo "12.0 MHZ CLock Enabled";; + "2") sudo sed -e 's/\/\/ #define EXTERNAL_OSC 14/ #define EXTERNAL_OSC 14/g' $conf > $conf.tmp && mv -f $conf.tmp $conf && echo "14.4 MHZ CLock Enabled";; + "3") sudo sed -e 's/\/\/ #define EXTERNAL_OSC 19/ #define EXTERNAL_OSC 19/g' $conf > $conf.tmp && mv -f $conf.tmp $conf && echo "19.2 MHZ CLock Enabled";; + "4") sudo sed -e 's/\/\/ #define USE/ #define USE/g' $conf > $conf.tmp && mv -f $conf.tmp $conf && echo "COS As Lockout Enabled";; + "5") sudo sed -e 's/\/\/ #define ARDUINO_MODE/ #define ARDUINO_MODE/g' $conf > $conf.tmp && mv -f $conf.tmp $conf && echo "Mode Pins Enabled";; + "6") MV -f $confbak $conf ;; + "Q") echo "If any changes are made you need to upload to MMDVM" && exit;; + "q") echo "If any changes are made you need to upload to MMDVM" && exit;; + * ) echo "invalid option" ;; + esac + sleep 1 +done