First release

This commit is contained in:
root 2018-09-29 11:23:01 +02:00
parent 90588bc8f2
commit bbf3886c7b
3 changed files with 24 additions and 22 deletions

View file

@ -5,7 +5,7 @@
# # # #
# (c)2018 by ON7LDS # # (c)2018 by ON7LDS #
# # # #
# V1.01 # # V1.02 #
# # # #
# This program changes the MMDVMHost configuration # # This program changes the MMDVMHost configuration #
# file to suit the needs of NextionDriver # # file to suit the needs of NextionDriver #
@ -45,7 +45,10 @@ fi
if [[ -f "$MMDVMConfig.old" ]]; then if [[ -f "$MMDVMConfig.old" ]]; then
echo "There already is a backup file $MMDVMConfig.old" echo "There already is a backup file $MMDVMConfig.old"
echo " If you are sure to run the installer again, then Please remove it." echo "This could be because NextionDriver already was installed earlier."
echo "If this is the case, there probably is no need to run this convertor."
echo "If, however, you are sure to run this convertor again,"
echo " then please rename or remove $MMDVMConfig.old."
exit 3 exit 3
fi fi

View file

@ -8,7 +8,7 @@ This is the first release. I have tested it on some hotspots
but there are always much more situations and combinations than but there are always much more situations and combinations than
the ones I tested :-) the ones I tested :-)
This repository also includes the cofiguration convertor program This repository also includes the configuration convertor program
for automatically converting the MMDVM.ini file to incorporate for automatically converting the MMDVM.ini file to incorporate
NextionDriver. NextionDriver.
You could just run it (NextionDriver_ConvertConfig) if you installed You could just run it (NextionDriver_ConvertConfig) if you installed
@ -38,12 +38,7 @@ get the installer
git clone https://github.com/on7lds/NextionDriverInstaller.git git clone https://github.com/on7lds/NextionDriverInstaller.git
``` ```
go to the installation program directory
```
cd NextionDriverInstaller
```
go ! go !
``` ```
sudo ./install.sh sudo NextionDriverInstaller/install.sh
``` ```

View file

@ -11,6 +11,12 @@
if [ "$(which gcc)" = "" ]; then echo "- I need gcc. Please install it." exit; fi if [ "$(which gcc)" = "" ]; then echo "- I need gcc. Please install it." exit; fi
if [ "$(which git)" = "" ]; then echo "- I need git. Please install it." exit; fi if [ "$(which git)" = "" ]; then echo "- I need git. Please install it." exit; fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" #"
if [ "$EUID" -ne 0 ]
then echo "- Please run as root (did you forget to prepend 'sudo' ?)"
exit
fi
echo "+ Getting NextionDriver ..." echo "+ Getting NextionDriver ..."
cd /tmp cd /tmp
@ -29,8 +35,9 @@ PISTAR=$(if [ -f /etc/pistar-release ];then echo "OK"; fi)
MMDVM=$(which MMDVMHost) MMDVM=$(which MMDVMHost)
BINDIR=$(echo "$MMDVM" | sed "s/MMDVMHost//") BINDIR=$(echo "$MMDVM" | sed "s/MMDVMHost//")
CONFIGFILE="MMDVM.ini" CONFIGFILE="MMDVM.ini"
CONFIGDIR="/etc" CONFIGDIR="/etc/"
MMDVMSTART="service mmdvmhost restart" MMDVMSTOP="service mmdvmhost stop"
MMDVMSTART="service mmdvmhost start"
######################################################### #########################################################
@ -64,8 +71,8 @@ checkversion () {
} }
helpfiles () { helpfiles () {
echo "+ Copying groups and users files" echo "+ Copying groups and users files"
cp /tmp/NextionDriverInstaller/groups.txt $CONFIGDIR cp $DIR/groups.txt $CONFIGDIR
cp /tmp/NextionDriverInstaller/stripped.csv $CONFIGDIR cp $DIR/stripped.csv $CONFIGDIR
} }
herstart () { herstart () {
echo -e "\n+ To test if it all works as expected," echo -e "\n+ To test if it all works as expected,"
@ -84,17 +91,13 @@ herstart () {
} }
if [ "$EUID" -ne 0 ]
then echo "- Please run as root"
exit
fi
if [ "$PISTAR" = "OK" ]; then if [ "$PISTAR" = "OK" ]; then
sudo mount -o remount,rw / ; sudo mount -o remount,rw /boot sudo mount -o remount,rw / ; sudo mount -o remount,rw /boot
CONFIGFILE="mmdvmhost" CONFIGFILE="mmdvmhost"
CONFIGDIR="/etc/" CONFIGDIR="/etc/"
MMDVMSTART="service mmdvmhost restart" MMDVMSTOP="service mmdvmhost stop"
MMDVMSTART="service mmdvmhost start"
else else
echo "" echo ""
echo "- This is not a Pi-Star." echo "- This is not a Pi-Star."
@ -122,8 +125,9 @@ fi
if [ "$ND" = "" ]; then if [ "$ND" = "" ]; then
echo "+ No NextionDriver found, trying to install one." echo "+ No NextionDriver found, trying to install one."
compileer compileer
service mmdvmhost stop $MMDVMSTOP
killall -q -I MMDVMHost killall -q -I MMDVMHost
cp $DIR"/mmdvmhost.service.pistar" /usr/local/sbin/mmdvmhost.service
cp NextionDriver $BINDIR cp NextionDriver $BINDIR
echo "+ Check version :" echo "+ Check version :"
NextionDriver -V NextionDriver -V
@ -132,7 +136,7 @@ if [ "$ND" = "" ]; then
echo -e "+ NextionDriver installed\n" echo -e "+ NextionDriver installed\n"
echo -e "+ -----------------------------------------------" echo -e "+ -----------------------------------------------"
echo -e "+ We will now start the configuration program ...\n" echo -e "+ We will now start the configuration program ...\n"
./NextionDriver_ConvertConfig $CONFIGDIR$CONFIGFILE $DIR/NextionDriver_ConvertConfig $CONFIGDIR$CONFIGFILE
herstart herstart
exit exit
fi fi
@ -147,7 +151,7 @@ echo "+ We are version $THISVERSION"
if [ $TV -gt $V ]; then if [ $TV -gt $V ]; then
echo "+ Start Update" echo "+ Start Update"
compileer compileer
service mmdvmhost stop $MMDVMSTOP
killall -q -I MMDVMHost killall -q -I MMDVMHost
cp NextionDriver $BINDIR cp NextionDriver $BINDIR
echo -e "\n+ Check version" echo -e "\n+ Check version"