Commit f54b04da authored by mlsuyt2718's avatar mlsuyt2718

add Raspbian GNU/Linux distribution as supported distribution

parent cd1b5763
......@@ -4,6 +4,7 @@
# Project : https://git.duniter.org/tuxmain/gmixer-py
# contact mail : <pytlin@protonmail.com>
VERSION="2019.05.04"
set -e
......@@ -166,7 +167,7 @@ getGmixerProject () {
generateConfFolder () {
noError="false"
if [ ! -d "$HOME/.gmixer" ]; then
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ]; then
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Raspbian GNU/Linux" ]; then
$HOME/gmixer-py/python3.7 server.py -i
checkCommand
elif [ "$OS" = "CentOS Linux" ]; then
......@@ -208,7 +209,7 @@ checkCommand() {
#update system with package manager : apt for debian derivative system and yum for centos derivated system
updateSystem () {
noError="false"
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ]; then
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Raspbian GNU/Linux" ]; then
sudo apt-get update -y && sudo apt-get upgrade -y
checkCommand
elif [ "$OS" = "CentOS Linux" ]; then
......@@ -223,7 +224,7 @@ updateSystem () {
#installation of dependancies for Python
installDepPython () {
noError="false"
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ]; then
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Raspbian GNU/Linux" ]; then
sudo apt-get install build-essential sqlite3 bzip2 libbz2-dev zlib1g-dev openssl libgdbm-dev liblzma-dev libreadline-dev libffi-dev apt-transport-https -y
checkCommand
elif [ "$OS" = "CentOS Linux" ]; then
......@@ -237,7 +238,7 @@ installDepPython () {
installDepPythonForGMixer () {
noError="false"
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ]; then
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Raspbian GNU/Linux" ]; then
sudo apt-get install python3-pip python3 python-dev python3-dev build-essential libffi-dev libxml2-dev libxslt1-dev zlib1g-dev -y 2> /dev/null
sudo pip3 install --upgrade pip 2> /dev/null
sudo pip3 install libnacl duniterpy silkaj py-ubjson plyvel PySocks 2> /dev/null
......@@ -256,7 +257,7 @@ installDepPythonForGMixer () {
#installation of dependancies for Gmixer
installDepGMixer () {
noError="false"
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ]; then
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Raspbian GNU/Linux" ]; then
sudo apt-get install libsodium-dev -y
checkCommand
elif [ "$OS" = "CentOS Linux" ]; then
......@@ -271,7 +272,7 @@ installDepGMixer () {
installPython () {
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ]; then
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Raspbian GNU/Linux" ]; then
if [ ! -d "/usr/src/Python-3.7.3" ]; then
cd /usr/src
......@@ -334,7 +335,7 @@ installPython () {
checkInstallCmake () {
noError="false"
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ]; then
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Raspbian GNU/Linux" ]; then
vCmake=$(cmake --version)
cmakeStr="cmake version 3.14.3"
if [ -z "${vCmake##*$cmakeStr*}" ]
......@@ -371,7 +372,7 @@ checkInstallCmake () {
checkInstallPython () {
noError="false"
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ]; then
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Raspbian GNU/Linux" ]; then
vPython=$(python3.7 -V)
pythonStr="Python"
if [ -z "${vPython##*$pythonStr*}" ]
......@@ -405,7 +406,7 @@ checkInstallPython () {
launchGMixer () {
noError="false"
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ]; then
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Raspbian GNU/Linux" ]; then
python3.7 $HOME/gmixer-py/server.py -s -d $HOME/.gmixer
elif [ "$OS" = "CentOS Linux" ]; then
python3.6 $HOME/gmixer-py/server.py -s -d $HOME/.gmixer
......@@ -418,7 +419,7 @@ launchGMixer () {
installOrBuildCmake () {
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ]; then
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Raspbian GNU/Linux" ]; then
if [ ! -d "/usr/src/cmake-3.14.3" ]; then
cd /usr/src
......@@ -469,7 +470,7 @@ checkBuildLevelDB () {
buildLevelDB () {
noError="false"
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ]; then
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Raspbian GNU/Linux" ]; then
cd /usr/src
sudo rm -rf /usr/src/1.21.tar.gz
#for plylevel install leveldb >=1.21 (build it by hand on debian stretch, CMake 3.9 or higher is required)
......@@ -521,7 +522,7 @@ checkTorInstallation () {
openPortGMixer () {
noError="false"
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ]; then
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Raspbian GNU/Linux" ]; then
sudo iptables -A INPUT -p tcp -m tcp --dport "$@" -j ACCEPT
sudo iptables -A OUTPUT -p tcp -m tcp --dport "$@" -j ACCEPT
......@@ -544,7 +545,7 @@ openPortGMixer () {
modifiyConfigurationFile () {
noError="false"
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ]; then
if [ "$OS" = "Debian GNU/Linux" ] || [ "$OS" = "Ubuntu" ] || [ "$OS" = "Raspbian GNU/Linux" ]; then
printf "%bretrieve public ip...%b" "${yellow}" "${rescolor}"
ip=$( getPublicIp )
sed -i "s/127.0.1.1/`echo $ip`/g" $HOME/.gmixer/config.json
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment