forked from axiom-team/astroport
84 lines
3.3 KiB
Bash
84 lines
3.3 KiB
Bash
|
#!/bin/bash
|
||
|
##################################################################
|
||
|
# Author: Fred (support@qo-op.com)
|
||
|
# Version: 0.1
|
||
|
# License: GPL (http://www.google.com/search?q=GPL)
|
||
|
##################################################################
|
||
|
|
||
|
MY_PATH="`dirname \"$0\"`" # relative
|
||
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||
|
source $MY_PATH/.install/.GPATH
|
||
|
|
||
|
# Adapter les valeurs au contexte spatio-temporel du NODE G1SMS
|
||
|
function log () {
|
||
|
# log ($1=text)
|
||
|
if [ "$DOLOG" == "YES" ]
|
||
|
then
|
||
|
echo "$PHONE:$1" >> /tmp/g1sms.log
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
|
||
|
###################################################################################################################################
|
||
|
fn_exists() {
|
||
|
# appended double quote is an ugly trick to make sure we do get a string -- if $1 is not a known command, type does not output anything
|
||
|
[ `type -t $1`"" == 'file' ]
|
||
|
}
|
||
|
# ATOMATIC gammu-smsd-inject desactivation if no gammu is installed on system
|
||
|
if ! fn_exists gammu-smsd-inject; then
|
||
|
log ":p) DESACTIVATION ENVOI DE SMS .............."
|
||
|
function gammu-smsd-inject () {
|
||
|
log "$PHONE: >>> SENDING SMS $4 TO $2 "
|
||
|
}
|
||
|
else
|
||
|
export G1SMS="YES"
|
||
|
fi
|
||
|
|
||
|
|
||
|
export YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1);
|
||
|
cd $GPATH
|
||
|
##################################################################
|
||
|
# Activate logging to /tmp/g1sms.log (YES/NO)
|
||
|
export DOLOG="YES"
|
||
|
export CPERROR="NOYES"
|
||
|
##################################################################
|
||
|
# Country Node Phone international prefix (TODO Worldwide)
|
||
|
export COUNTRY="+33"
|
||
|
##################################################################
|
||
|
# DU has a G1 value changed every 6 month!
|
||
|
# ./_DU Updated by cron_CODE.backup.sh
|
||
|
if [[ -f "./_DU" ]]; then export DUFACTOR=$(bc <<< "scale=2; $(cat "./_DU") / 100"); else log "__SUB:init.sh: FAILING TO FIND ./_DU EXIT!!!"; exit; fi
|
||
|
##################################################################
|
||
|
# Choose Default Unit: G1, DU, LOVE (DU cents), ZEN (G1 cents)
|
||
|
export COIN="G1"
|
||
|
##################################################################
|
||
|
# Limit and commission values
|
||
|
export LIMIT=2 # Solde minimum = 2 G1
|
||
|
# FIXED COMMISSION SYSTEM
|
||
|
export COMMISSION=1 # transaction commission amount (G1)
|
||
|
export BILLCOM=20
|
||
|
##################################################################
|
||
|
# COMMISSION PARTS FROM TX FOR NODE & G1SMS NETWORK
|
||
|
# PART COMMISSION SYSTEM
|
||
|
export SWARMCOMM=10
|
||
|
# TODO: NODE G1sms Wallet can receive rewards from SWARM or WALLETS/FILES
|
||
|
export NODECOMM=10
|
||
|
##################################################################
|
||
|
# SMS SIM Card Phone Number
|
||
|
export MASTERPHONE="+33651136520"
|
||
|
export ADRESSE="G1_Fablab_Toulouse"
|
||
|
export G1DAB="NO"
|
||
|
##################################################################
|
||
|
# ADMIN COMMAND PHONE ORIGIN
|
||
|
export ADMINPHONE="+33647683646"
|
||
|
export ADMINPSEUDO="Fred"
|
||
|
##################################################################
|
||
|
# DUNITER/CESIUM+ DEFAULT SERVERS
|
||
|
export DUNITER="https://g1.duniter.org"
|
||
|
export CESIUM="https://g1.data.le-sou.org"
|
||
|
|
||
|
# TODO Use latest Silkaj from "sudo fredp3 install silkaj"
|
||
|
# export SILKAJ="/usr/local/bin/silkaj"
|
||
|
source $GPATH/shell/init_keys.sh
|
||
|
|