Merge branch 'dev-poka'
This commit is contained in:
commit
bfbb4a414f
|
@ -13,5 +13,5 @@ history.*
|
||||||
*~
|
*~
|
||||||
.install/errors
|
.install/errors
|
||||||
.install/log
|
.install/log
|
||||||
shell/init.sh.old
|
.install/.OS
|
||||||
.profile
|
.profile
|
||||||
|
|
|
@ -2,50 +2,99 @@
|
||||||
|
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
isARM=$(uname -a | grep arm)
|
|
||||||
|
OS=$(head -n1 $MY_PATH/.OS)
|
||||||
|
isARM=$(cat $MY_PATH/.OS | grep YES)
|
||||||
|
unset err
|
||||||
|
|
||||||
# Basics
|
# Basics
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install curl jq zip unzip htop tree ntpdate gnupg ssmtp mpack imagemagick qrencode bc libttspico-utils libttspico0 libttspico-data -y
|
echo -e "${c_yellow}Mise à jours des prérequis...$c_"
|
||||||
|
sudo apt install curl jq zip unzip htop tree ntpdate gnupg ssmtp mpack imagemagick qrencode bc -y
|
||||||
|
|
||||||
# Silkaj + Duniterpy
|
# Silkaj + Duniterpy
|
||||||
libsodium=$(sudo apt search libsodium | grep -v "header" | grep -v "debug symbols" | grep "Network communication" -B1 | head -n1 | awk -F '/' '{ print $1 }')
|
silkaj() {
|
||||||
sudo apt install python3-pip $libsodium -y
|
echo -e "${c_yellow}Installation de Silkaj...$c_"
|
||||||
pip3 install duniterpy
|
libsodium=$(sudo apt search libsodium 2>/dev/null | grep -v -E "header|debug symbols" | grep "Network communication" -B1 | head -n1 | awk -F '/' '{ print $1 }')
|
||||||
pip3 install silkaj --user
|
[[ $libsodium =~ " " ]] && libsodium=$(echo $libsodium | awk '{ print $2 }')
|
||||||
|
sudo apt install python3-pip $libsodium -y || err+="Install python3 and $libsodium"
|
||||||
|
pip3 install duniterpy || err+="Install duniterpy"
|
||||||
|
pip3 install silkaj --user || err+="Install Silkaj"
|
||||||
|
}
|
||||||
|
|
||||||
# Install IPFS
|
# Install IPFS
|
||||||
|
ipfs() {
|
||||||
|
echo -e "${c_yellow}Installation d'IPFS...$c_"
|
||||||
[[ -f /usr/local/bin/ipfs ]] && sudo service ipfs stop
|
[[ -f /usr/local/bin/ipfs ]] && sudo service ipfs stop
|
||||||
if [[ -z $isARM ]]; then
|
if [[ $isARM ]]; then
|
||||||
wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-amd64.tar.gz -O $MY_PATH/ipfs-update.tar.gz
|
wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-arm.tar.gz -O $MY_PATH/ipfs-update.tar.gz || err+="Download ipfs-update"
|
||||||
else
|
else
|
||||||
wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-arm.tar.gz -O $MY_PATH/ipfs-update.tar.gz
|
wget https://dist.ipfs.io/ipfs-update/v1.5.2/ipfs-update_v1.5.2_linux-amd64.tar.gz -O $MY_PATH/ipfs-update.tar.gz || err+="Download ipfs-update"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "INSTALL ipfs-update"
|
echo "INSTALL ipfs-update"
|
||||||
sudo tar -xvzf $MY_PATH/ipfs-update.tar.gz -C /usr/src/
|
sudo tar -xvzf $MY_PATH/ipfs-update.tar.gz -C /usr/src/ || err+="Untar ipfs-update"
|
||||||
rm $MY_PATH/ipfs-update.tar.gz
|
rm $MY_PATH/ipfs-update.tar.gz
|
||||||
cd /usr/src/ipfs-update/
|
cd /usr/src/ipfs-update/
|
||||||
sudo ./install.sh
|
sudo ./install.sh || err+="Install ipfs-update"
|
||||||
cd $MY_PATH
|
cd $MY_PATH
|
||||||
|
|
||||||
echo "INSTALL latest ipfs"
|
echo "INSTALL latest ipfs"
|
||||||
sudo ipfs-update install latest
|
sudo ipfs-update install latest || err+="Install IPFS"
|
||||||
|
|
||||||
echo "CREATE SYSTEMD ipfs SERVICE"
|
echo "CREATE SYSTEMD ipfs SERVICE"
|
||||||
[[ -f /etc/systemd/system/ipfs.service ]] && sudo rm /etc/systemd/system/ipfs.service
|
[[ -f /etc/systemd/system/ipfs.service ]] && sudo rm /etc/systemd/system/ipfs.service
|
||||||
sudo cp -f $MY_PATH/templates/ipfs.service /etc/systemd/system/
|
sudo cp -f $MY_PATH/templates/1/ipfs.service /etc/systemd/system/
|
||||||
sudo sed -i "s/_USER/$USER/g" /etc/systemd/system/ipfs.service
|
sudo sed -i "s/_USER/$USER/g" /etc/systemd/system/ipfs.service
|
||||||
|
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload || err+="Restart IPFS"
|
||||||
sudo systemctl enable ipfs
|
sudo systemctl enable ipfs || err+="Enable IPFS daemon"
|
||||||
|
}
|
||||||
|
|
||||||
# Install gammu
|
# Install gammu
|
||||||
sudo apt install ppp screen git minicom gammu -y
|
gammu() {
|
||||||
|
echo -e "${c_yellow}Installation de gammu...$c_"
|
||||||
|
sudo apt install ppp screen git minicom gammu -y || err+="Install gammu requirements"
|
||||||
sleep 1
|
sleep 1
|
||||||
sudo apt install gammu-smsd -y || sudo apt install -f
|
sudo apt install gammu-smsd -y || sudo apt install -f || err+="Install gammu"
|
||||||
|
|
||||||
sudo usermod -aG gammu $USER
|
sudo usermod -aG gammu $USER
|
||||||
|
}
|
||||||
|
|
||||||
|
# Install PHP + MySQL
|
||||||
|
php() {
|
||||||
|
echo -e "${c_yellow}Installation de PHP et MySQL$c_"
|
||||||
|
if [[ $OS == "buster" ]]; then
|
||||||
|
sudo apt -y install software-properties-common nginx php php-common php-fpm php-gettext php-gd php-mysql php-curl php-imap php-mbstring php-xml php-cli mariadb-server || err+="Install PHP and MySQL"
|
||||||
|
elif [[ $OS == "stretch" ]]; then
|
||||||
|
sudo apt -y install lsb-release apt-transport-https ca-certificates || err+="Install apt-transport-https"
|
||||||
|
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg || err+="Download PHP key"
|
||||||
|
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php7.3.list
|
||||||
|
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 || err+="Download PHP key"
|
||||||
|
sudo apt update
|
||||||
|
sudo apt -y install software-properties-common dirmngr nginx php7.3 php7.3-common php7.3-gettext php7.3-fpm php7.3-gd php7.3-mysql php7.3-curl php7.3-imap php7.3-mbstring php7.3-xml php7.3-cli mariadb-server || err+="Install PHP and MySQL"
|
||||||
|
else
|
||||||
|
echo "${c_red}Votre système n'est pas pris en charge par ce script d'installation.$c_"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
isLocalhostUsers=$(sudo mysql -e "select user from mysql.user;" | grep "localhost")
|
||||||
|
isTestDB=$(sudo mysql -e "show databases" | grep "test")
|
||||||
|
[[ -n $isLocalhostUsers ]] && sudo mysql -e "DROP USER ''@'localhost'; DROP USER ''@'$(hostname)'"
|
||||||
|
[[ -n $isTestDB ]] && sudo mysql -e "DROP DATABASE test"
|
||||||
|
sudo mysql -e "FLUSH PRIVILEGES"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Read arguments
|
||||||
|
for i in $@; do
|
||||||
|
echo -e "${c_yellow}Installation de $c_light$i$c_"
|
||||||
|
$i
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ $err ]]; then
|
||||||
|
echo -e "${c_red}Installation des prérequis incomplète: $err$c_"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo -e "${c_green}Les prérequis ont été correctement installés$c_"
|
||||||
exit 0
|
exit 0
|
||||||
|
fi
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
stamp=$(date +%s)
|
stamp=$(date +%s)
|
||||||
templates="$MY_PATH/templates"
|
templates="$MY_PATH/templates/2"
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# CONFIGURE IPFS for G1sms+ Pi NODES
|
# CONFIGURE IPFS for G1sms+ Pi NODES
|
||||||
|
|
|
@ -2,43 +2,49 @@
|
||||||
|
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
templates="$MY_PATH/templates"
|
templates="$MY_PATH/templates/3"
|
||||||
|
|
||||||
isARM=$(uname -a | grep arm)
|
isARM=$(cat $MY_PATH/.OS | grep YES)
|
||||||
|
|
||||||
##################################
|
##################################
|
||||||
## INSTALL TOOLS
|
## INSTALL TOOLS
|
||||||
######## YOUTUBE-DL ##########
|
######## YOUTUBE-DL ##########
|
||||||
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
|
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl || err=1
|
||||||
sudo chmod a+rx /usr/local/bin/youtube-dl
|
sudo chmod a+rx /usr/local/bin/youtube-dl
|
||||||
sudo apt install libid3-tools mpd mpc lame -y
|
|
||||||
|
## TODO FOR DEBIAN STRETCH
|
||||||
|
|
||||||
|
wget -q https://ftp-master.debian.org/keys/release-10.asc -O- | sudo apt-key add -
|
||||||
|
echo "deb http://deb.debian.org/debian buster non-free" | sudo tee -a /etc/apt/sources.list
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install libid3-tools mpd mpc lame -y libttspico-utils -y || err=1
|
||||||
|
|
||||||
|
|
||||||
## CONFIG MPD
|
## CONFIG MPD
|
||||||
sudo cp -f $templates/mpd.conf /etc/mpd.conf
|
sudo cp -f $templates/mpd.conf /etc/mpd.conf
|
||||||
sudo sed -i "s/_USER/$USER/g" /etc/mpd.conf
|
sudo sed -i "s/_USER/$USER/g" /etc/mpd.conf || err=1
|
||||||
|
|
||||||
sudo chown -R $USER /var/lib/mpd/ /var/run/mpd /run/mpd /var/log/mpd
|
sudo chown -R $USER /var/lib/mpd/ /var/run/mpd /run/mpd /var/log/mpd
|
||||||
sudo service mpd restart
|
sudo service mpd restart || err=1
|
||||||
|
|
||||||
|
|
||||||
sudo apt-get install nginx php-curl php-sqlite3 php-gd php-json php-xml php-mbstring php-fpm sqlite -y
|
sudo apt-get install nginx php-curl php-sqlite3 php-gd php-json php-xml php-mbstring php-fpm sqlite -y || err=1
|
||||||
sudo apt-get install lame sox libsox-fmt-mp3 eyed3 python-chardet imagemagick curl -y #libav-tools
|
sudo apt-get install lame sox libsox-fmt-mp3 eyed3 python-chardet imagemagick curl -y #libav-tools || err=1
|
||||||
sudo apt-get install ca-certificates git-core binutils rsync alsa-utils bc libid3-tools espeak mpg321 fuse atomicparsley -y #libttspico-utils
|
sudo apt-get install ca-certificates git-core binutils rsync alsa-utils bc libid3-tools espeak mpg321 fuse atomicparsley -y || err=1
|
||||||
|
|
||||||
wget http://launchpadlibrarian.net/339874908/libav-tools_3.3.4-2_all.deb -O $MY_PATH/libav-tools.deb
|
wget http://launchpadlibrarian.net/339874908/libav-tools_3.3.4-2_all.deb -O $MY_PATH/libav-tools.deb
|
||||||
wget http://ftp.fr.debian.org/debian/pool/non-free/s/svox/libttspico-data_1.0+git20130326-3_all.deb -O $MY_PATH/libttspico-data.deb
|
wget http://ftp.fr.debian.org/debian/pool/non-free/s/svox/libttspico-data_1.0+git20130326-3_all.deb -O $MY_PATH/libttspico-data.deb
|
||||||
if [[ -z $isARM ]]; then
|
if [[ $isARM ]]; then
|
||||||
wget http://ftp.fr.debian.org/debian/pool/non-free/s/svox/libttspico0_1.0+git20130326-5_amd64.deb -O $MY_PATH/libttspico0.deb
|
|
||||||
wget http://ftp.fr.debian.org/debian/pool/non-free/s/svox/libttspico-utils_1.0+git20130326-9_amd64.deb -O $MY_PATH/libttspico-utils.deb
|
|
||||||
else
|
|
||||||
wget http://ftp.fr.debian.org/debian/pool/non-free/s/svox/libttspico0_1.0+git20130326-3_armhf.deb -O $MY_PATH/libttspico0.deb
|
wget http://ftp.fr.debian.org/debian/pool/non-free/s/svox/libttspico0_1.0+git20130326-3_armhf.deb -O $MY_PATH/libttspico0.deb
|
||||||
wget http://ftp.fr.debian.org/debian/pool/non-free/s/svox/libttspico-utils_1.0+git20130326-3_armhf.deb -O $MY_PATH/libttspico-utils.deb
|
wget http://ftp.fr.debian.org/debian/pool/non-free/s/svox/libttspico-utils_1.0+git20130326-3_armhf.deb -O $MY_PATH/libttspico-utils.deb
|
||||||
|
else
|
||||||
|
wget http://ftp.fr.debian.org/debian/pool/non-free/s/svox/libttspico0_1.0+git20130326-5_amd64.deb -O $MY_PATH/libttspico0.deb
|
||||||
|
wget http://ftp.fr.debian.org/debian/pool/non-free/s/svox/libttspico-utils_1.0+git20130326-9_amd64.deb -O $MY_PATH/libttspico-utils.deb
|
||||||
fi
|
fi
|
||||||
sudo dpkg -i $MY_PATH/libttspico-data.deb
|
sudo dpkg -i $MY_PATH/libttspico-data.deb || err=1
|
||||||
sudo dpkg -i $MY_PATH/libttspico0.deb
|
sudo dpkg -i $MY_PATH/libttspico0.deb || err=1
|
||||||
sudo dpkg -i $MY_PATH/libttspico-utils.deb
|
sudo dpkg -i $MY_PATH/libttspico-utils.deb || err=1
|
||||||
sudo dpkg -i $MY_PATH/libav-tools.deb || sudo apt --fix-broken install -y
|
sudo dpkg -i $MY_PATH/libav-tools.deb || sudo apt --fix-broken install -y || err=1
|
||||||
rm $MY_PATH/libttspico-data.deb $MY_PATH/libttspico0.deb $MY_PATH/libttspico-utils.deb $MY_PATH/libav-tools.deb
|
rm $MY_PATH/libttspico-data.deb $MY_PATH/libttspico0.deb $MY_PATH/libttspico-utils.deb $MY_PATH/libav-tools.deb
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,7 +52,7 @@ rm $MY_PATH/libttspico-data.deb $MY_PATH/libttspico0.deb $MY_PATH/libttspico-uti
|
||||||
sudo cp -f $templates/default /etc/nginx/sites-available/
|
sudo cp -f $templates/default /etc/nginx/sites-available/
|
||||||
sudo sed -i "s/_USER/$USER/g" /etc/nginx/sites-available/default
|
sudo sed -i "s/_USER/$USER/g" /etc/nginx/sites-available/default
|
||||||
|
|
||||||
sudo systemctl restart nginx
|
sudo systemctl restart nginx || err=1
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
## Get _CopyLaRadio distrib
|
## Get _CopyLaRadio distrib
|
||||||
|
@ -61,4 +67,11 @@ sudo systemctl restart nginx
|
||||||
#sudo chmod 777 /home/$USER/_CopyLaRadio/www/rompr/albumart
|
#sudo chmod 777 /home/$USER/_CopyLaRadio/www/rompr/albumart
|
||||||
#sudo chmod 777 /home/$USER/_CopyLaRadio/www/rompr/prefs
|
#sudo chmod 777 /home/$USER/_CopyLaRadio/www/rompr/prefs
|
||||||
|
|
||||||
|
if [[ $err ]]; then
|
||||||
|
echo -e "${c_red}Installation de copylaradio incomplète$c_"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo -e "${c_green}CopyLaRadio a été installé avec succès$c_"
|
||||||
exit 0
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1,157 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
MY_PATH="`dirname \"$0\"`" # relative
|
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
|
||||||
|
|
||||||
[[ -f $MY_PATH/../.profile ]] && source $MY_PATH/../.profile
|
|
||||||
unset err
|
|
||||||
pwdDB=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 42 | head -n 1)
|
|
||||||
|
|
||||||
args=$@
|
|
||||||
[[ $args =~ noask ]] && noask=o && askSSL=o
|
|
||||||
|
|
||||||
[[ ! $PSMS_DOMAIN ]] && echo -e "${c_yellow}Choisissez un nom de domain pour playsms: $c_" && read PSMS_DOMAIN
|
|
||||||
|
|
||||||
sudo apt -y update
|
|
||||||
sudo apt -y install unzip zip
|
|
||||||
if [[ $(grep buster /etc/os-release) ]]; then
|
|
||||||
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
|
|
||||||
sudo add-apt-repository 'deb [arch=amd64] http://mariadb.mirror.liquidtelecom.com/repo/10.4/debian buster main'
|
|
||||||
sudo apt -y update
|
|
||||||
sudo apt -y install software-properties-common nginx php php-common php-fpm php-gettext php-gd php-mysql php-curl php-imap php-mbstring php-xml php-cli mariadb-server
|
|
||||||
elif [[ $(grep stretch /etc/os-release) ]]; then
|
|
||||||
sudo apt -y install lsb-release apt-transport-https ca-certificates
|
|
||||||
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
|
|
||||||
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php7.3.list
|
|
||||||
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
|
|
||||||
echo -e "deb [arch=amd64,i386,ppc64el] http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.4/debian stretch main\ndeb-src http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.4/debian stretch main" | sudo tee /etc/apt/sources.list.d/mariadb.list
|
|
||||||
sudo apt -y update
|
|
||||||
sudo apt -y install software-properties-common dirmngr nginx php7.3 php7.3-common php7.3-gettext php7.3-fpm php7.3-gd php7.3-mysql php7.3-curl php7.3-imap php7.3-mbstring php7.3-xml php7.3-cli mariadb-server
|
|
||||||
else
|
|
||||||
echo "${c_red}Votre système n'est pas pris en charge par ce script d'installation.$c_"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Create database
|
|
||||||
|
|
||||||
if [[ ! $(sudo mysql -e "show databases;" | grep playsms) ]]; then
|
|
||||||
sudo mysql -e "CREATE DATABASE playsms"
|
|
||||||
sudo mysql -e "CREATE USER 'playsms'@'localhost' IDENTIFIED BY '$pwdDB';"
|
|
||||||
sudo mysql -e "GRANT ALL PRIVILEGES ON playsms.* TO 'playsms'@'localhost';"
|
|
||||||
sudo mysql -e "FLUSH PRIVILEGES;"
|
|
||||||
else
|
|
||||||
sudo mysql -e "ALTER USER 'playsms'@'localhost' IDENTIFIED BY '$pwdDB';"
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Clone repo playSMS
|
|
||||||
[[ -d $MY_PATH/playsms ]] && sudo rm -rf $MY_PATH/playsms
|
|
||||||
git clone https://github.com/antonraharja/playSMS.git $MY_PATH/playsms
|
|
||||||
|
|
||||||
cp $MY_PATH/templates/install-playsms.conf $MY_PATH/playsms/install.conf
|
|
||||||
sed -i "s/_pwdDB/$pwdDB/g" $MY_PATH/playsms/install.conf
|
|
||||||
|
|
||||||
[[ -d /var/www/playsms ]] && sudo rm -rf /var/www/playsms
|
|
||||||
sudo chmod u+x $MY_PATH/playsms/install-playsms.sh
|
|
||||||
cd $MY_PATH/playsms
|
|
||||||
sed -i "s/read /confirm=y; #read /g" install-playsms.sh
|
|
||||||
sudo ./install-playsms.sh
|
|
||||||
sudo sed -i "/ishttps/d" /var/www/playsms/config.php
|
|
||||||
sudo sed -i "/http or https*/a \$core_config['ishttps'] = true;" /var/www/playsms/config.php
|
|
||||||
[[ -d $MY_PATH/playsms ]] && sudo rm -rf $MY_PATH/playsms
|
|
||||||
cd $MY_PATH
|
|
||||||
|
|
||||||
## Start playsmsd on boot
|
|
||||||
sudo /usr/local/bin/playsmsd start
|
|
||||||
|
|
||||||
if [[ -f /etc/rc.local ]]; then
|
|
||||||
[[ ! $(grep playsmsd /etc/rc.local) ]] && sudo sed -i '/^exit 0.*/i /usr/local/bin/playsmsd start' /etc/rc.local
|
|
||||||
else
|
|
||||||
echo "/usr/local/bin/playsmsd start" | sudo tee /etc/rc.local
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Tests
|
|
||||||
if [[ $(sudo playsmsd status) =~ "is running" ]]; then
|
|
||||||
echo -e "${c_green}playSMS a été installé correctement et le daemon est démarré =)$c_"
|
|
||||||
else
|
|
||||||
echo -e "${c_red}Une erreur est survenu$c_"
|
|
||||||
err=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Config NGINX
|
|
||||||
|
|
||||||
[[ ! -d /etc/nginx/def_conf ]] && sudo mkdir /etc/nginx/def_conf/
|
|
||||||
sudo cp $MY_PATH/templates/proxypass.conf /etc/nginx/def_conf/
|
|
||||||
sudo cp $MY_PATH/templates/playsms.conf /etc/nginx/conf.d/
|
|
||||||
sudo sed -i "s/_PSMS_DOMAIN/$PSMS_DOMAIN/" /etc/nginx/conf.d/playsms.conf
|
|
||||||
|
|
||||||
## Active SSL
|
|
||||||
|
|
||||||
manageSSL() {
|
|
||||||
|
|
||||||
local action=$1
|
|
||||||
[[ ! $action =~ ^(on|off|certif)$ ]] && echo "Veuillez choisir ssl, nonssl ou certif pour créer un certificat ssl" && exit 1
|
|
||||||
|
|
||||||
install_certbot(){
|
|
||||||
sudo apt update
|
|
||||||
if [[ $(grep -E 'stretch|buster' /etc/os-release) ]]; then
|
|
||||||
sudo apt install certbot python-certbot-nginx -y
|
|
||||||
elif [[ $(grep -E '16.|17.|18.|19.' /etc/os-release) ]]; then
|
|
||||||
sudo apt install software-properties-common
|
|
||||||
sudo add-apt-repository universe
|
|
||||||
sudo add-apt-repository ppa:certbot/certbot
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install certbot python-certbot-nginx
|
|
||||||
else
|
|
||||||
echo "OS non supporté pour certbot." && exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
create_certificate() {
|
|
||||||
sudo certbot --nginx certonly --non-interactive --agree-tos -m $USER@$PSMS_DOMAIN -d $PSMS_DOMAIN && echo "Le certificat de $PSMS_DOMAIN a bien été déployé" || echo "Une erreur s'est produite lors de la création du certificat SSL"
|
|
||||||
|
|
||||||
## Cronification
|
|
||||||
[[ ! -e /opt/scripts ]] && sudo mkdir /opt/scripts
|
|
||||||
sudo cp $MY_PATH/templates/ssl_renew.sh /opt/scripts/
|
|
||||||
[[ -z $(sudo crontab -l | grep "/opt/scripts/ssl_renew.sh") ]] && (sudo crontab -l ; sudo echo "12 2 * * 1 /opt/scripts/ssl_renew.sh") | sudo crontab -u root -
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
case $action in
|
|
||||||
on)
|
|
||||||
sudo sed -i 's/ #if/ if/' /etc/nginx/conf.d/playsms.conf
|
|
||||||
|
|
||||||
sudo sed -i "s/listen 443;/listen 443 ssl;/" /etc/nginx/conf.d/playsms.conf
|
|
||||||
[[ ! -d /etc/nginx/includes ]] && sudo mkdir /etc/nginx/includes
|
|
||||||
sudo cp $MY_PATH/templates/ssl.conf /etc/nginx/includes/
|
|
||||||
sudo sed -i "/Content-Security-Policy/a \ include includes/ssl.conf;\n ssl_certificate /etc/letsencrypt/live/$PSMS_DOMAIN/fullchain.pem;\n ssl_certificate_key /etc/letsencrypt/live/$PSMS_DOMAIN/privkey.pem;" /etc/nginx/conf.d/playsms.conf
|
|
||||||
;;
|
|
||||||
|
|
||||||
off)
|
|
||||||
sudo sed -i 's/ if/ #if/' /etc/nginx/conf.d/playsms.conf
|
|
||||||
sudo sed -i '/ssl.conf;/d' /etc/nginx/conf.d/playsms.conf
|
|
||||||
sudo sed -i '/ssl_certificate/d' /etc/nginx/conf.d/playsms.conf
|
|
||||||
;;
|
|
||||||
certif)
|
|
||||||
[[ -z $(which certbot) ]] && install_certbot
|
|
||||||
[[ -n /etc/letsencrypt/live/$PSMS_DOMAIN/fullchain.pem ]] && create_certificate
|
|
||||||
;;
|
|
||||||
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
echo -e "${c_yellow}playSMS ne fonctionne pas sans certifcat SSL.$c_"
|
|
||||||
[[ ! $noask ]] && printf "${c_yellow}Voulez-vous installer et activer un certificat SSL maintenant pour $PSMS_DOMAIN ? (o/n) $c_" && read askSSL
|
|
||||||
if [[ $askSSL =~ ^(o|y|yes|oui|Y|O|YES)$ ]]; then
|
|
||||||
manageSSL certif
|
|
||||||
if sudo test -f /etc/letsencrypt/live/$PSMS_DOMAIN/fullchain.pem; then manageSSL on; else manageSSL off && echo "Une erreur s'est produite, basculement vers le mode non SSL"; fi
|
|
||||||
http=https
|
|
||||||
else
|
|
||||||
manageSSL off
|
|
||||||
http=http
|
|
||||||
fi
|
|
||||||
|
|
||||||
sudo service nginx restart
|
|
||||||
|
|
||||||
[[ ! $err ]] && echo -e "${c_green}Félicitation ! playSMS est accessible via l'URL $http://$PSMS_DOMAIN" || echo -e "${c_red}Installation incomplète$c_"
|
|
||||||
|
|
||||||
exit 0
|
|
|
@ -0,0 +1,113 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
|
|
||||||
|
[[ -f $MY_PATH/../.profile ]] && source $MY_PATH/../.profile
|
||||||
|
unset err
|
||||||
|
|
||||||
|
args=$@
|
||||||
|
[[ $args =~ noask ]] && noask=o && askSSL=o
|
||||||
|
|
||||||
|
IP=$(ifconfig | grep "inet " | grep -v "127.0.0.1" | awk '{ print $2 }')
|
||||||
|
[[ ! $KSMS_DOMAIN ]] && echo -e "${c_yellow}Choisissez un nom de domaine pour KALKUN (Sinon $IP sera choisi): $c_" && read KSMS_DOMAIN
|
||||||
|
[[ ! $KSMS_DOMAIN ]] && KSMS_DOMAIN=$IP && askSSL=n && noask=o
|
||||||
|
|
||||||
|
DOMAIN=$KSMS_DOMAIN
|
||||||
|
|
||||||
|
## Install PHP + MySQL
|
||||||
|
$MY_PATH/1-install_requirements.sh php
|
||||||
|
|
||||||
|
## Create database
|
||||||
|
if [[ $(sudo mysql -e "select * from mysql.user;" | grep gammu) ]]; then
|
||||||
|
pwdDB=$(cat /etc/gammu-smsdrc | grep "password" | grep -v "# " | awk '{ print $3 }')
|
||||||
|
else
|
||||||
|
pwdDB=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 42 | head -n 1)
|
||||||
|
sudo mysql -e "CREATE USER 'gammu'@'localhost' IDENTIFIED BY '$pwdDB';"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! $(sudo mysql -e "show databases;" | grep gammu) ]]; then
|
||||||
|
echo -e "${c_yellow}Création de la base de donnée...$c_"
|
||||||
|
sudo mysql -e "CREATE DATABASE gammu"
|
||||||
|
sudo mysql -e "GRANT ALL PRIVILEGES ON gammu.* TO 'gammu'@'localhost';"
|
||||||
|
sudo mysql -e "FLUSH PRIVILEGES;"
|
||||||
|
fi
|
||||||
|
if [[ -z $(sudo mysql gammu -e "SHOW TABLES LIKE 'outbox';") ]]; then
|
||||||
|
echo -e "${c_yellow}Importation du dump gammu...$c_"
|
||||||
|
sudo mysql gammu < $MY_PATH/templates/4a/mysql.sql || err+="Import dump MySQL"
|
||||||
|
fi
|
||||||
|
if [[ -z $(sudo mysql gammu -e "SHOW TABLES LIKE 'kalkun';") ]]; then
|
||||||
|
echo -e "${c_yellow}Importation du dump kalkun...$c_"
|
||||||
|
sudo mysql gammu < $MY_PATH/templates/4a/kalkun.sql || err+="Import dump Kalkun"
|
||||||
|
fi
|
||||||
|
|
||||||
|
## Clone repo KALKUN
|
||||||
|
|
||||||
|
[[ -d $MY_PATH/kalkun ]] && sudo rm -rf $MY_PATH/kalkun
|
||||||
|
echo -e "${c_yellow}Clonage du dépot de Kalkun...$c_"
|
||||||
|
git clone https://github.com/back2arie/Kalkun.git $MY_PATH/kalkun
|
||||||
|
|
||||||
|
cp $MY_PATH/templates/4a/database.php $MY_PATH/kalkun/application/config/
|
||||||
|
cp $MY_PATH/templates/4a/daemon.sh $MY_PATH/templates/4a/daemon.php $MY_PATH/kalkun/scripts
|
||||||
|
sed -i "s/_PWD/$pwdDB/g" $MY_PATH/kalkun/application/config/database.php || err+="Sed database password"
|
||||||
|
sed -i "s/_DOMAIN/$DOMAIN/g" $MY_PATH/templates/4a/daemon.php || err+="Sed domaine to daemon.php"
|
||||||
|
|
||||||
|
# touch $MY_PATH/kalkun/install
|
||||||
|
|
||||||
|
## Place le dossier kalkun dans /var/www/
|
||||||
|
[[ -d /var/www/kalkun ]] && sudo rm -rf /var/www/kalkun
|
||||||
|
sudo mv $MY_PATH/kalkun /var/www/ || err+="Move kalkun to /var/www"
|
||||||
|
sudo chown -R www-data:www-data /var/www/kalkun || err+="Chown www-data to kalkun"
|
||||||
|
sudo chmod u+x /var/www/kalkun/scripts/*
|
||||||
|
|
||||||
|
## Add daemon launcher in sms_received.sh
|
||||||
|
[[ ! $(grep "Execute Kalkun daemon" $MY_PATH/../sms_received.sh) ]] && sed -i "/^export YOU/i # Execute Kalkun daemon\n/var/www/kalkun/scripts/daemon.sh &\n" $MY_PATH/../sms_received.sh
|
||||||
|
|
||||||
|
## Active gammu in MySQL mode
|
||||||
|
if [[ $(grep "service = files" /etc/gammu-smsdrc) ]]; then
|
||||||
|
echo -e "${c_yellow}Activation de gammu-smsd en mode MySQL...$c_"
|
||||||
|
sudo sed -i "/^service = files/a service = sql\ndriver = native_mysql\nhost = localhost\nuser = gammu\npassword = $pwdDB\ndatabase = gammu" /etc/gammu-smsdrc || err+="Sed gammu-smsd"
|
||||||
|
sudo sed -i "/service = files/d" /etc/gammu-smsdrc || err+="Sed delete in gammu-smsd"
|
||||||
|
$MY_PATH/../debug/gammu-restart.sh || err+="Restart gammu"
|
||||||
|
fi
|
||||||
|
|
||||||
|
## Config NGINX
|
||||||
|
|
||||||
|
echo -e "${c_yellow}Configuration de Nginx...$c_"
|
||||||
|
[[ ! -d /etc/nginx/def_conf ]] && sudo mkdir /etc/nginx/def_conf/
|
||||||
|
sudo cp $MY_PATH/templates/rproxy/proxypass.conf /etc/nginx/def_conf/ || err+="Copy proxypass.conf"
|
||||||
|
sudo cp $MY_PATH/templates/4a/kalkun.conf /etc/nginx/conf.d/ || err+="Copy kalkun.conf"
|
||||||
|
sudo sed -i "s/_DOMAIN/$DOMAIN/g" /etc/nginx/conf.d/kalkun.conf || err+="Sed domain in kalkun.conf"
|
||||||
|
|
||||||
|
## Active SSL
|
||||||
|
|
||||||
|
[[ ! $noask ]] && printf "${c_yellow}Voulez-vous installer et activer un certificat SSL maintenant pour $DOMAIN ? (o/n) $c_" && read askSSL
|
||||||
|
if [[ $askSSL =~ ^(o|y|yes|oui|Y|O|YES)$ ]]; then
|
||||||
|
if sudo test ! -f /etc/letsencrypt/live/$DOMAIN/fullchain.pem; then
|
||||||
|
$MY_PATH/ssl.sh certif APP=kalkun DOMAIN=$DOMAIN || err+="Create SSL certification"
|
||||||
|
fi
|
||||||
|
if sudo test -f /etc/letsencrypt/live/$DOMAIN/fullchain.pem; then
|
||||||
|
$MY_PATH/ssl.sh on APP=kalkun DOMAIN=$DOMAIN || err+="Enable SSL certification"
|
||||||
|
else
|
||||||
|
echo -e "${c_red}Une erreur s'est produite, basculement vers le mode non SSL$c_"
|
||||||
|
$MY_PATH/ssl.sh off APP=kalkun DOMAIN=$DOMAIN || err+="Disable SSL certification"
|
||||||
|
fi
|
||||||
|
http=https
|
||||||
|
sudo sed -i "s/http/https/g" /var/www/kalkun/scripts/daemon.php || err+="Sed http to https in daemon.php"
|
||||||
|
else
|
||||||
|
$MY_PATH/ssl.sh off APP=kalkun DOMAIN=$DOMAIN || err+="Disable SSL certification"
|
||||||
|
http=http
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "${c_yellow}Redémarrage de Nginx...$c_"
|
||||||
|
sudo service nginx restart || err+="Restart Nginx"
|
||||||
|
echo -e "${c_yellow}Redémarrage de gammu-smsd...$c_"
|
||||||
|
$MY_PATH/../debug/gammu-restart.sh || err+="Restart gammu"
|
||||||
|
|
||||||
|
if [[ $err ]]; then
|
||||||
|
echo -e "${c_red}Installation incomplète: $err$c_"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo -e "${c_green}Kalkun est accessible via l'URL $http://$DOMAIN$c_"
|
||||||
|
exit 0
|
||||||
|
fi
|
|
@ -0,0 +1,102 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
|
|
||||||
|
[[ -f $MY_PATH/../.profile ]] && source $MY_PATH/../.profile
|
||||||
|
unset err
|
||||||
|
pwdDB=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 42 | head -n 1)
|
||||||
|
|
||||||
|
args=$@
|
||||||
|
[[ $args =~ noask ]] && noask=o && askSSL=o
|
||||||
|
|
||||||
|
IP=$(ifconfig | grep "inet " | grep -v "127.0.0.1" | awk '{ print $2 }')
|
||||||
|
[[ ! $PSMS_DOMAIN ]] && echo -e "${c_yellow}Choisissez un nom de domaine pour PlaySMS (Sinon $IP sera choisi): $c_" && read PSMS_DOMAIN
|
||||||
|
[[ ! $PSMS_DOMAIN ]] && PSMS_DOMAIN=$IP && askSSL=n && noask=o
|
||||||
|
|
||||||
|
|
||||||
|
DOMAIN=$PSMS_DOMAIN
|
||||||
|
|
||||||
|
## Install PHP + MySQL
|
||||||
|
$MY_PATH/1-install_requirements.sh php
|
||||||
|
|
||||||
|
## Create database
|
||||||
|
|
||||||
|
if [[ $(sudo mysql -e "show databases;" | grep gammu) ]]; then
|
||||||
|
pwdDB=$(cat /etc/gammu-smsdrc | grep "password" | grep -v "# " | awk '{ print $3 }')
|
||||||
|
else
|
||||||
|
sudo mysql -e "CREATE DATABASE gammu"
|
||||||
|
sudo mysql -e "CREATE USER 'gammu'@'localhost' IDENTIFIED BY '$pwdDB';"
|
||||||
|
sudo mysql -e "GRANT ALL PRIVILEGES ON gammu.* TO 'gammu'@'localhost';"
|
||||||
|
sudo mysql -e "FLUSH PRIVILEGES;"
|
||||||
|
fi
|
||||||
|
|
||||||
|
## Clone repo playSMS
|
||||||
|
[[ -d $MY_PATH/playsms ]] && sudo rm -rf $MY_PATH/playsms
|
||||||
|
git clone https://github.com/antonraharja/playSMS.git $MY_PATH/playsms
|
||||||
|
|
||||||
|
cp $MY_PATH/templates/4b/install-playsms.conf $MY_PATH/playsms/install.conf
|
||||||
|
sed -i "s/_pwdDB/$pwdDB/g" $MY_PATH/playsms/install.conf
|
||||||
|
|
||||||
|
[[ -d /var/www/playsms ]] && sudo rm -rf /var/www/playsms
|
||||||
|
sudo chmod u+x $MY_PATH/playsms/install-playsms.sh
|
||||||
|
cd $MY_PATH/playsms
|
||||||
|
sed -i "s/read /confirm=y; #read /g" install-playsms.sh
|
||||||
|
sudo ./install-playsms.sh
|
||||||
|
sudo sed -i "/ishttps/d" /var/www/playsms/config.php
|
||||||
|
sudo sed -i "/http or https*/a \$core_config['ishttps'] = true;" /var/www/playsms/config.php
|
||||||
|
[[ -d $MY_PATH/playsms ]] && sudo rm -rf $MY_PATH/playsms
|
||||||
|
cd $MY_PATH
|
||||||
|
|
||||||
|
## Start playsmsd on boot
|
||||||
|
sudo /usr/local/bin/playsmsd start
|
||||||
|
|
||||||
|
if [[ -f /etc/rc.local ]]; then
|
||||||
|
[[ ! $(grep playsmsd /etc/rc.local) ]] && sudo sed -i '/^exit 0.*/i /usr/local/bin/playsmsd start' /etc/rc.local
|
||||||
|
else
|
||||||
|
echo "/usr/local/bin/playsmsd start" | sudo tee /etc/rc.local
|
||||||
|
fi
|
||||||
|
|
||||||
|
## Tests
|
||||||
|
if [[ $(sudo playsmsd status) =~ "is running" ]]; then
|
||||||
|
echo -e "${c_green}playSMS a été installé correctement et le daemon est démarré =)$c_"
|
||||||
|
else
|
||||||
|
echo -e "${c_red}Une erreur est survenu$c_"
|
||||||
|
err=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
## Config NGINX
|
||||||
|
|
||||||
|
[[ ! -d /etc/nginx/def_conf ]] && sudo mkdir /etc/nginx/def_conf/
|
||||||
|
sudo cp $MY_PATH/templates/rproxy/proxypass.conf /etc/nginx/def_conf/
|
||||||
|
sudo cp $MY_PATH/templates/4b/playsms.conf /etc/nginx/conf.d/
|
||||||
|
sudo sed -i "s/_DOMAIN/$DOMAIN/" /etc/nginx/conf.d/playsms.conf
|
||||||
|
|
||||||
|
## Active SSL
|
||||||
|
|
||||||
|
echo -e "${c_yellow}playSMS ne fonctionne pas sans certifcat SSL.$c_"
|
||||||
|
[[ ! $noask ]] && printf "${c_yellow}Voulez-vous installer et activer un certificat SSL maintenant pour $DOMAIN ? (o/n) $c_" && read askSSL
|
||||||
|
if [[ $askSSL =~ ^(o|y|yes|oui|Y|O|YES)$ ]]; then
|
||||||
|
$MY_PATH/ssl.sh certif APP=playsms DOMAIN=$DOMAIN
|
||||||
|
if sudo test -f /etc/letsencrypt/live/$DOMAIN/fullchain.pem; then
|
||||||
|
$MY_PATH/ssl.sh on APP=playsms DOMAIN=$DOMAIN
|
||||||
|
else
|
||||||
|
echo -e "${c_red}Une erreur s'est produite, basculement vers le mode non SSL$c_"
|
||||||
|
$MY_PATH/ssl.sh off APP=playsms DOMAIN=$DOMAIN
|
||||||
|
fi
|
||||||
|
http=https
|
||||||
|
else
|
||||||
|
$MY_PATH/ssl.sh off APP=playsms DOMAIN=$DOMAIN
|
||||||
|
http=http
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo service nginx restart
|
||||||
|
|
||||||
|
if [[ $err ]]; then
|
||||||
|
echo -e "${c_red}Installation incomplète$c_"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo -e "${c_green}PlaySMS est accessible via l'URL $http://$DOMAIN$c_"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
|
|
||||||
|
### Vars
|
||||||
|
args=$(echo $@ | tr " " "\n")
|
||||||
|
|
||||||
|
if [[ "$args" =~ "DOMAIN=" ]]; then
|
||||||
|
DOMAIN=$(echo "$args" | grep "\<DOMAIN=" | awk -F '=' '{ print $2 }')
|
||||||
|
else
|
||||||
|
echo "Veuillez sélectionner un domaine avec DOMAIN=mondommain.com"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ "$args" =~ "APP=" ]]; then
|
||||||
|
APP=$(echo "$args" | grep "\<APP=" | awk -F '=' '{ print $2 }')
|
||||||
|
else
|
||||||
|
echo "Veuillez sélectionner une application avec APP=monapp"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
action=$(echo "$args" | grep -v "=")
|
||||||
|
[[ ! $action =~ ^(on|off|certif)$ ]] && echo "Veuillez choisir on, off ou certif pour créer un certificat ssl" && exit 1
|
||||||
|
###
|
||||||
|
|
||||||
|
install_certbot(){
|
||||||
|
sudo apt update
|
||||||
|
if [[ $(grep -E 'stretch|buster' /etc/os-release) ]]; then
|
||||||
|
sudo apt install certbot python-certbot-nginx -y
|
||||||
|
elif [[ $(grep -E '16.|17.|18.|19.' /etc/os-release) ]]; then
|
||||||
|
sudo apt install software-properties-common
|
||||||
|
sudo add-apt-repository universe
|
||||||
|
sudo add-apt-repository ppa:certbot/certbot
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install certbot python-certbot-nginx
|
||||||
|
else
|
||||||
|
echo "OS non supporté pour certbot." && exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
create_certificate() {
|
||||||
|
sudo certbot --nginx certonly --non-interactive --agree-tos -m $USER@$DOMAIN -d $DOMAIN && echo "Le certificat de $DOMAIN a bien été déployé" || echo "Une erreur s'est produite lors de la création du certificat SSL"
|
||||||
|
|
||||||
|
## Cronification
|
||||||
|
[[ ! -e /opt/scripts ]] && sudo mkdir /opt/scripts
|
||||||
|
sudo cp $MY_PATH/templates/rproxy/ssl_renew.sh /opt/scripts/
|
||||||
|
[[ -z $(sudo crontab -l | grep "/opt/scripts/ssl_renew.sh") ]] && (sudo crontab -l ; sudo echo "12 2 * * 1 /opt/scripts/ssl_renew.sh") | sudo crontab -u root -
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
case $action in
|
||||||
|
on)
|
||||||
|
sudo sed -i 's/ #if/ if/g' /etc/nginx/conf.d/$APP.conf
|
||||||
|
|
||||||
|
sudo sed -i "s/listen 443;/listen 443 ssl;/g" /etc/nginx/conf.d/$APP.conf
|
||||||
|
[[ ! -d /etc/nginx/includes ]] && sudo mkdir /etc/nginx/includes
|
||||||
|
sudo cp $MY_PATH/templates/rproxy/ssl.conf /etc/nginx/includes/
|
||||||
|
sudo sed -i "/Content-Security-Policy/a \ include includes/ssl.conf;\n ssl_certificate /etc/letsencrypt/live/$DOMAIN/fullchain.pem;\n ssl_certificate_key /etc/letsencrypt/live/$DOMAIN/privkey.pem;" /etc/nginx/conf.d/$APP.conf
|
||||||
|
;;
|
||||||
|
|
||||||
|
off)
|
||||||
|
sudo sed -i "s/ if/ #if/g" /etc/nginx/conf.d/$APP.conf
|
||||||
|
sudo sed -i "/ssl.conf;/d" /etc/nginx/conf.d/$APP.conf
|
||||||
|
sudo sed -i "/ssl_certificate/d" /etc/nginx/conf.d/$APP.conf
|
||||||
|
;;
|
||||||
|
certif)
|
||||||
|
[[ ! $(which certbot) ]] && install_certbot
|
||||||
|
if sudo test ! -f /etc/letsencrypt/live/$DOMAIN/fullchain.pem; then create_certificate; fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
|
@ -0,0 +1,34 @@
|
||||||
|
# Configuration file for Gammu SMS Daemon
|
||||||
|
|
||||||
|
# Gammu library configuration, see gammurc(5)
|
||||||
|
[gammu]
|
||||||
|
# Please configure this!
|
||||||
|
port = /dev/ttyUSB0
|
||||||
|
synchronizetime = yes
|
||||||
|
gammucoding = utf8
|
||||||
|
connection = at
|
||||||
|
# Debugging
|
||||||
|
logformat = textall
|
||||||
|
|
||||||
|
# SMSD configuration, see gammu-smsdrc(5)
|
||||||
|
[smsd]
|
||||||
|
#service = files
|
||||||
|
service = sql
|
||||||
|
driver = native_mysql
|
||||||
|
host = localhost
|
||||||
|
user = playsms
|
||||||
|
password = DlNHoAZQbuCBJYYI0a1TWfu8X6197pDY6GfARLLUSB
|
||||||
|
database = kalkun
|
||||||
|
|
||||||
|
logfile = /var/log/gammu-smsd.log
|
||||||
|
# Increase for debugging information
|
||||||
|
smsc = 33695000695
|
||||||
|
PIN = 1234
|
||||||
|
|
||||||
|
# Paths where messages are stored
|
||||||
|
inboxpath = /var/spool/gammu/inbox/
|
||||||
|
outboxpath = /var/spool/gammu/outbox/
|
||||||
|
sentsmspath = /var/spool/gammu/sent/
|
||||||
|
errorsmspath = /var/spool/gammu/error/
|
||||||
|
|
||||||
|
debuglevel = 4
|
|
@ -0,0 +1,3 @@
|
||||||
|
/key/swarm/psk/1.0.0/
|
||||||
|
/base16/
|
||||||
|
66f6fcfa6e89bc14721d905370dae9026442eb44fa4d0c92464da887074a234f
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
// Make sure it's run from CLI
|
||||||
|
if(php_sapi_name() != 'cli' && !empty($_SERVER['REMOTE_ADDR'])) exit("Access Denied.");
|
||||||
|
|
||||||
|
// Please configure this
|
||||||
|
$url = "https://g1sms-blois-2.p2p.legal";
|
||||||
|
|
||||||
|
fclose(fopen($url."/index.php/daemon/message_routine/", "r"));
|
||||||
|
|
||||||
|
?>
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Configure this (use absolute path)
|
||||||
|
PHP=/usr/bin/php # php cli path
|
||||||
|
DAEMON=/var/www/kalkun/scripts/daemon.php # daemon.php path
|
||||||
|
|
||||||
|
# Execute
|
||||||
|
$PHP $DAEMON
|
|
@ -0,0 +1,58 @@
|
||||||
|
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||||
|
/*
|
||||||
|
| -------------------------------------------------------------------
|
||||||
|
| DATABASE CONNECTIVITY SETTINGS
|
||||||
|
| -------------------------------------------------------------------
|
||||||
|
| This file will contain the settings needed to access your database.
|
||||||
|
|
|
||||||
|
| For complete instructions please consult the "Database Connection"
|
||||||
|
| page of the User Guide.
|
||||||
|
|
|
||||||
|
| -------------------------------------------------------------------
|
||||||
|
| EXPLANATION OF VARIABLES
|
||||||
|
| -------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| ['hostname'] The hostname of your database server.
|
||||||
|
| ['username'] The username used to connect to the database
|
||||||
|
| ['password'] The password used to connect to the database
|
||||||
|
| ['database'] The name of the database you want to connect to
|
||||||
|
| ['dbdriver'] The database type. ie: mysql. Currently supported:
|
||||||
|
mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
|
||||||
|
| ['dbprefix'] You can add an optional prefix, which will be added
|
||||||
|
| to the table name when using the Active Record class
|
||||||
|
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
|
||||||
|
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
|
||||||
|
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
|
||||||
|
| ['cachedir'] The path to the folder where cache files should be stored
|
||||||
|
| ['char_set'] The character set used in communicating with the database
|
||||||
|
| ['dbcollat'] The character collation used in communicating with the database
|
||||||
|
|
|
||||||
|
| The $active_group variable lets you choose which connection group to
|
||||||
|
| make active. By default there is only one group (the "default" group).
|
||||||
|
|
|
||||||
|
| The $active_record variables lets you determine whether or not to load
|
||||||
|
| the active record class
|
||||||
|
*/
|
||||||
|
|
||||||
|
$active_group = "default";
|
||||||
|
$active_record = TRUE;
|
||||||
|
|
||||||
|
$db['default']['hostname'] = "127.0.0.1";
|
||||||
|
|
||||||
|
// MySQL
|
||||||
|
$db['default']['username'] = "gammu";
|
||||||
|
$db['default']['password'] = "_PWD";
|
||||||
|
$db['default']['database'] = "gammu";
|
||||||
|
$db['default']['dbdriver'] = "mysqli";
|
||||||
|
|
||||||
|
$db['default']['dbprefix'] = "";
|
||||||
|
$db['default']['pconnect'] = FALSE;
|
||||||
|
$db['default']['db_debug'] = TRUE;
|
||||||
|
$db['default']['cache_on'] = FALSE;
|
||||||
|
$db['default']['cachedir'] = "";
|
||||||
|
$db['default']['char_set'] = "utf8";
|
||||||
|
$db['default']['dbcollat'] = "utf8_general_ci";
|
||||||
|
|
||||||
|
|
||||||
|
/* End of file database.php */
|
||||||
|
/* Location: ./application/config/database.php */
|
|
@ -0,0 +1,40 @@
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen 443;
|
||||||
|
listen [::]:443 ssl;
|
||||||
|
server_name _DOMAIN;
|
||||||
|
|
||||||
|
add_header Content-Security-Policy upgrade-insecure-requests;
|
||||||
|
# add_header 'Access-Control-Allow-Origin' '*';
|
||||||
|
|
||||||
|
#if ($http_x_forwarded_proto = "http") { return 301 https://$server_name$request_uri; }
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri/ $uri /index.php?/$request_uri; # =404;
|
||||||
|
include /etc/nginx/def_conf/proxypass.conf;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
index index.php index.html;
|
||||||
|
root /var/www/kalkun;
|
||||||
|
|
||||||
|
# set expiration of assets to MAX for caching
|
||||||
|
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
|
||||||
|
expires max;
|
||||||
|
log_not_found off;
|
||||||
|
}
|
||||||
|
|
||||||
|
# php parsing
|
||||||
|
location ~ \.php$ {
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_log /var/log/nginx/kalkun_error.log;
|
||||||
|
access_log /var/log/nginx/kalkun_access.log;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,331 @@
|
||||||
|
-- phpMyAdmin SQL Dump
|
||||||
|
-- version 3.2.0.1
|
||||||
|
-- http://www.phpmyadmin.net
|
||||||
|
--
|
||||||
|
-- Host: localhost
|
||||||
|
-- Generation Time: Feb 22, 2011 at 05:38 PM
|
||||||
|
-- Server version: 5.1.37
|
||||||
|
-- PHP Version: 5.3.0
|
||||||
|
|
||||||
|
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
|
||||||
|
|
||||||
|
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||||
|
/*!40101 SET NAMES utf8 */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Database: `kalkun`
|
||||||
|
--
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `kalkun`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `kalkun` (
|
||||||
|
`version` text NOT NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `sms_used`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `sms_used` (
|
||||||
|
`id_sms_used` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`sms_date` date NOT NULL,
|
||||||
|
`id_user` int(11) NOT NULL,
|
||||||
|
`out_sms_count` int(11) NOT NULL DEFAULT '0',
|
||||||
|
`in_sms_count` int(11) NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`id_sms_used`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `user`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `user` (
|
||||||
|
`id_user` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`username` varchar(12) NOT NULL,
|
||||||
|
`realname` varchar(100) NOT NULL,
|
||||||
|
`password` varchar(255) NOT NULL,
|
||||||
|
`phone_number` varchar(15) NOT NULL,
|
||||||
|
`level` enum('admin','user') NOT NULL DEFAULT 'user',
|
||||||
|
PRIMARY KEY (`id_user`),
|
||||||
|
UNIQUE KEY `username` (`username`),
|
||||||
|
UNIQUE KEY `phone_number` (`phone_number`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `user`
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT INTO `user` (`id_user`, `username`, `realname`, `password`, `phone_number`, `level`) VALUES
|
||||||
|
(1, 'kalkun', 'Kalkun SMS', 'f0af18413d1c9e0366d8d1273160f55d5efeddfe', '123456789', 'admin');
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `user_folders`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `user_folders` (
|
||||||
|
`id_folder` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` varchar(50) NOT NULL,
|
||||||
|
`id_user` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`id_folder`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `user_folders`
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT INTO `user_folders` (`id_folder`, `name`, `id_user`) VALUES
|
||||||
|
(1, 'inbox', 0),
|
||||||
|
(2, 'outbox', 0),
|
||||||
|
(3, 'sent_items', 0),
|
||||||
|
(4, 'draft', 0),
|
||||||
|
(5, 'Trash', 0),
|
||||||
|
(6, 'Spam', 0);
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `user_inbox`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `user_inbox` (
|
||||||
|
`id_inbox` int(11) NOT NULL,
|
||||||
|
`id_user` int(11) NOT NULL,
|
||||||
|
`trash` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`id_inbox`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `user_outbox`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `user_outbox` (
|
||||||
|
`id_outbox` int(11) NOT NULL,
|
||||||
|
`id_user` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`id_outbox`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `user_sentitems`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `user_sentitems` (
|
||||||
|
`id_sentitems` int(11) NOT NULL,
|
||||||
|
`id_user` int(11) NOT NULL,
|
||||||
|
`trash` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`id_sentitems`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `user_settings`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `user_settings` (
|
||||||
|
`id_user` int(11) NOT NULL,
|
||||||
|
`theme` varchar(10) NOT NULL DEFAULT 'blue',
|
||||||
|
`signature` varchar(50) NOT NULL,
|
||||||
|
`permanent_delete` enum('true','false') NOT NULL DEFAULT 'false',
|
||||||
|
`paging` int(2) NOT NULL DEFAULT '10',
|
||||||
|
`bg_image` varchar(50) NOT NULL,
|
||||||
|
`delivery_report` enum('default','yes','no') NOT NULL DEFAULT 'default',
|
||||||
|
`language` varchar(20) NOT NULL DEFAULT 'english',
|
||||||
|
`conversation_sort` enum('asc','desc') NOT NULL DEFAULT 'asc',
|
||||||
|
`country_code` varchar(2) NOT NULL DEFAULT 'US',
|
||||||
|
PRIMARY KEY (`id_user`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `user_settings`
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT INTO `user_settings` (`id_user`, `theme`, `signature`, `permanent_delete`, `paging`, `bg_image`, `delivery_report`, `language`, `conversation_sort`) VALUES
|
||||||
|
(1, 'green', 'false;--\nPut your signature here', 'false', 20, 'true;background.jpg', 'default' , 'english', 'asc');
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Alter table structure for table `inbox`
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE `inbox` ADD `id_folder` INT( 11 ) NOT NULL DEFAULT '1',
|
||||||
|
ADD `readed` ENUM( 'false', 'true' ) NOT NULL DEFAULT 'false';
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Alter table structure for table `sentitems`
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE `sentitems` ADD `id_folder` INT( 11 ) NOT NULL DEFAULT '3';
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
-- mulai versi db 16, pbk dan pbk__groups dihapus di gammu
|
||||||
|
--
|
||||||
|
-- Alter table structure for table `pbk`
|
||||||
|
--
|
||||||
|
CREATE TABLE `pbk` (
|
||||||
|
`ID` integer NOT NULL auto_increment,
|
||||||
|
`GroupID` integer NOT NULL default '-1',
|
||||||
|
`Name` text NOT NULL,
|
||||||
|
`Number` text NOT NULL,
|
||||||
|
PRIMARY KEY (`ID`)
|
||||||
|
);
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `pbk`
|
||||||
|
--
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `pbk_groups`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `pbk_groups` (
|
||||||
|
`Name` text NOT NULL,
|
||||||
|
`ID` integer NOT NULL auto_increment,
|
||||||
|
PRIMARY KEY `ID` (`ID`)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE `pbk` ADD `id_user` INT( 11 ) NOT NULL;
|
||||||
|
ALTER TABLE `pbk` ADD `is_public` enum('true','false') NOT NULL DEFAULT 'false';
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Alter table structure for table `pbk_groups`
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE `pbk_groups` ADD `id_user` INT( 11 ) NOT NULL;
|
||||||
|
ALTER TABLE `pbk_groups` ADD `is_public` enum('true','false') NOT NULL DEFAULT 'false';
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `user_group`
|
||||||
|
--
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `user_group` (
|
||||||
|
`id_group` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`id_pbk` int(11) NOT NULL,
|
||||||
|
`id_pbk_groups` int(11) NOT NULL,
|
||||||
|
`id_user` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`id_group`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `user_templates`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `user_templates` (
|
||||||
|
`id_template` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`id_user` int(11) NOT NULL,
|
||||||
|
`Name` varchar(64) NOT NULL,
|
||||||
|
`Message` text NOT NULL,
|
||||||
|
PRIMARY KEY (`id_template`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `b8_wordlist`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `b8_wordlist` (
|
||||||
|
`token` varchar(255) character set utf8 collate utf8_bin NOT NULL,
|
||||||
|
`count` varchar(255) default NULL,
|
||||||
|
PRIMARY KEY (`token`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
INSERT INTO `b8_wordlist` VALUES ('bayes*dbversion', '2');
|
||||||
|
INSERT INTO `b8_wordlist` VALUES ('bayes*texts.ham', '0');
|
||||||
|
INSERT INTO `b8_wordlist` VALUES ('bayes*texts.spam', '0');
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `plugins`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `plugins` (
|
||||||
|
`plugin_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`plugin_system_name` varchar(255) NOT NULL,
|
||||||
|
`plugin_name` varchar(255) NOT NULL,
|
||||||
|
`plugin_uri` varchar(120) DEFAULT NULL,
|
||||||
|
`plugin_version` varchar(30) NULL,
|
||||||
|
`plugin_description` text,
|
||||||
|
`plugin_author` varchar(120) DEFAULT NULL,
|
||||||
|
`plugin_author_uri` varchar(120) DEFAULT NULL,
|
||||||
|
`plugin_data` longtext,
|
||||||
|
PRIMARY KEY (`plugin_id`),
|
||||||
|
UNIQUE KEY `plugin_index` (`plugin_system_name`) USING BTREE
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `user_forgot_password`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `user_forgot_password` (
|
||||||
|
`id_user` int(11) NOT NULL,
|
||||||
|
`token` varchar(255) NOT NULL,
|
||||||
|
`valid_until` datetime NOT NULL,
|
||||||
|
PRIMARY KEY (`id_user`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `user_filters`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `user_filters` (
|
||||||
|
`id_filter` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`id_user` int(11) NOT NULL,
|
||||||
|
`from` varchar(15) NOT NULL,
|
||||||
|
`has_the_words` varchar(50) NOT NULL,
|
||||||
|
`id_folder` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`id_filter`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE `ci_sessions` (
|
||||||
|
`id` varchar(40) NOT NULL,
|
||||||
|
`ip_address` varchar(45) NOT NULL,
|
||||||
|
`timestamp` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
|
`data` blob NOT NULL,
|
||||||
|
KEY `ci_sessions_timestamp` (`timestamp`)
|
||||||
|
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
|
@ -0,0 +1,180 @@
|
||||||
|
--
|
||||||
|
-- Database for Gammu SMSD
|
||||||
|
--
|
||||||
|
-- In case you get errors about not supported charset, please
|
||||||
|
-- replace utf8mb4 with utf8.
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `gammu`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `gammu` (
|
||||||
|
`Version` integer NOT NULL default '0' PRIMARY KEY
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `gammu`
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT IGNORE INTO `gammu` (`Version`) VALUES (17);
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `inbox`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `inbox` (
|
||||||
|
`UpdatedInDB` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||||
|
`ReceivingDateTime` timestamp NOT NULL default CURRENT_TIMESTAMP,
|
||||||
|
`Text` text NOT NULL,
|
||||||
|
`SenderNumber` varchar(20) NOT NULL default '',
|
||||||
|
`Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL default 'Default_No_Compression',
|
||||||
|
`UDH` text NOT NULL,
|
||||||
|
`SMSCNumber` varchar(20) NOT NULL default '',
|
||||||
|
`Class` integer NOT NULL default '-1',
|
||||||
|
`TextDecoded` text NOT NULL,
|
||||||
|
`ID` integer unsigned NOT NULL auto_increment,
|
||||||
|
`RecipientID` text NOT NULL,
|
||||||
|
`Processed` enum('false','true') NOT NULL default 'false',
|
||||||
|
`Status` integer NOT NULL default '-1',
|
||||||
|
PRIMARY KEY `ID` (`ID`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `inbox`
|
||||||
|
--
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `outbox`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `outbox` (
|
||||||
|
`UpdatedInDB` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||||
|
`InsertIntoDB` timestamp NOT NULL default CURRENT_TIMESTAMP,
|
||||||
|
`SendingDateTime` timestamp NOT NULL default CURRENT_TIMESTAMP,
|
||||||
|
`SendBefore` time NOT NULL DEFAULT '23:59:59',
|
||||||
|
`SendAfter` time NOT NULL DEFAULT '00:00:00',
|
||||||
|
`Text` text,
|
||||||
|
`DestinationNumber` varchar(20) NOT NULL default '',
|
||||||
|
`Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL default 'Default_No_Compression',
|
||||||
|
`UDH` text,
|
||||||
|
`Class` integer default '-1',
|
||||||
|
`TextDecoded` text NOT NULL,
|
||||||
|
`ID` integer unsigned NOT NULL auto_increment,
|
||||||
|
`MultiPart` enum('false','true') default 'false',
|
||||||
|
`RelativeValidity` integer default '-1',
|
||||||
|
`SenderID` varchar(255),
|
||||||
|
`SendingTimeOut` timestamp NULL default CURRENT_TIMESTAMP,
|
||||||
|
`DeliveryReport` enum('default','yes','no') default 'default',
|
||||||
|
`CreatorID` text NOT NULL,
|
||||||
|
`Retries` int(3) default 0,
|
||||||
|
`Priority` integer default 0,
|
||||||
|
`Status` enum('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending','DeliveryUnknown','Error','Reserved') NOT NULL default 'Reserved',
|
||||||
|
`StatusCode` integer NOT NULL default '-1',
|
||||||
|
PRIMARY KEY `ID` (`ID`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
CREATE INDEX outbox_date ON outbox(SendingDateTime, SendingTimeOut);
|
||||||
|
CREATE INDEX outbox_sender ON outbox(SenderID(250));
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `outbox`
|
||||||
|
--
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `outbox_multipart`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `outbox_multipart` (
|
||||||
|
`Text` text,
|
||||||
|
`Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL default 'Default_No_Compression',
|
||||||
|
`UDH` text,
|
||||||
|
`Class` integer default '-1',
|
||||||
|
`TextDecoded` text,
|
||||||
|
`ID` integer unsigned NOT NULL default '0',
|
||||||
|
`SequencePosition` integer NOT NULL default '1',
|
||||||
|
`Status` enum('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending','DeliveryUnknown','Error','Reserved') NOT NULL default 'Reserved',
|
||||||
|
`StatusCode` integer NOT NULL default '-1',
|
||||||
|
PRIMARY KEY (`ID`, `SequencePosition`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `outbox_multipart`
|
||||||
|
--
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `phones`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `phones` (
|
||||||
|
`ID` text NOT NULL,
|
||||||
|
`UpdatedInDB` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||||
|
`InsertIntoDB` timestamp NOT NULL default CURRENT_TIMESTAMP,
|
||||||
|
`TimeOut` timestamp NOT NULL default CURRENT_TIMESTAMP,
|
||||||
|
`Send` enum('yes','no') NOT NULL default 'no',
|
||||||
|
`Receive` enum('yes','no') NOT NULL default 'no',
|
||||||
|
`IMEI` varchar(35) NOT NULL,
|
||||||
|
`IMSI` varchar(35) NOT NULL,
|
||||||
|
`NetCode` varchar(10) default 'ERROR',
|
||||||
|
`NetName` varchar(35) default 'ERROR',
|
||||||
|
`Client` text NOT NULL,
|
||||||
|
`Battery` integer NOT NULL DEFAULT -1,
|
||||||
|
`Signal` integer NOT NULL DEFAULT -1,
|
||||||
|
`Sent` int NOT NULL DEFAULT 0,
|
||||||
|
`Received` int NOT NULL DEFAULT 0,
|
||||||
|
PRIMARY KEY (`IMEI`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `phones`
|
||||||
|
--
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `sentitems`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `sentitems` (
|
||||||
|
`UpdatedInDB` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||||
|
`InsertIntoDB` timestamp NOT NULL default CURRENT_TIMESTAMP,
|
||||||
|
`SendingDateTime` timestamp NOT NULL default CURRENT_TIMESTAMP,
|
||||||
|
`DeliveryDateTime` timestamp NULL,
|
||||||
|
`Text` text NOT NULL,
|
||||||
|
`DestinationNumber` varchar(20) NOT NULL default '',
|
||||||
|
`Coding` enum('Default_No_Compression','Unicode_No_Compression','8bit','Default_Compression','Unicode_Compression') NOT NULL default 'Default_No_Compression',
|
||||||
|
`UDH` text NOT NULL,
|
||||||
|
`SMSCNumber` varchar(20) NOT NULL default '',
|
||||||
|
`Class` integer NOT NULL default '-1',
|
||||||
|
`TextDecoded` text NOT NULL,
|
||||||
|
`ID` integer unsigned NOT NULL default '0',
|
||||||
|
`SenderID` varchar(255) NOT NULL,
|
||||||
|
`SequencePosition` integer NOT NULL default '1',
|
||||||
|
`Status` enum('SendingOK','SendingOKNoReport','SendingError','DeliveryOK','DeliveryFailed','DeliveryPending','DeliveryUnknown','Error') NOT NULL default 'SendingOK',
|
||||||
|
`StatusError` integer NOT NULL default '-1',
|
||||||
|
`TPMR` integer NOT NULL default '-1',
|
||||||
|
`RelativeValidity` integer NOT NULL default '-1',
|
||||||
|
`CreatorID` text NOT NULL,
|
||||||
|
`StatusCode` integer NOT NULL default '-1',
|
||||||
|
PRIMARY KEY (`ID`, `SequencePosition`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||||
|
|
||||||
|
CREATE INDEX sentitems_date ON sentitems(DeliveryDateTime);
|
||||||
|
CREATE INDEX sentitems_tpmr ON sentitems(TPMR);
|
||||||
|
CREATE INDEX sentitems_dest ON sentitems(DestinationNumber);
|
||||||
|
CREATE INDEX sentitems_sender ON sentitems(SenderID(250));
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `sentitems`
|
||||||
|
--
|
|
@ -1,11 +1,11 @@
|
||||||
# MySQL database username
|
# MySQL database username
|
||||||
DBUSER="playsms"
|
DBUSER="gammu"
|
||||||
|
|
||||||
# MySQL database password
|
# MySQL database password
|
||||||
DBPASS="_pwdDB"
|
DBPASS="_pwdDB"
|
||||||
|
|
||||||
# MySQL database name
|
# MySQL database name
|
||||||
DBNAME="playsms"
|
DBNAME="gammu"
|
||||||
|
|
||||||
# MySQL database host
|
# MySQL database host
|
||||||
DBHOST="localhost"
|
DBHOST="localhost"
|
|
@ -2,7 +2,7 @@ server {
|
||||||
listen 80;
|
listen 80;
|
||||||
listen 443;
|
listen 443;
|
||||||
listen [::]:443 ssl;
|
listen [::]:443 ssl;
|
||||||
server_name _PSMS_DOMAIN;
|
server_name _DOMAIN;
|
||||||
|
|
||||||
add_header Content-Security-Policy upgrade-insecure-requests;
|
add_header Content-Security-Policy upgrade-insecure-requests;
|
||||||
add_header 'Access-Control-Allow-Origin' '*';
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
|
@ -16,7 +16,7 @@ server {
|
||||||
|
|
||||||
|
|
||||||
index index.php index.html;
|
index index.php index.html;
|
||||||
root /var/www/playsms/;
|
root /var/www/playsms;
|
||||||
|
|
||||||
# set expiration of assets to MAX for caching
|
# set expiration of assets to MAX for caching
|
||||||
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
|
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
|
|
@ -88,6 +88,7 @@ Ajouter le lancement de ce script au démarrage (dans /etc/rc.local)
|
||||||
*Pour une installation manuelle: https://pad.p2p.legal/G1sms-install*
|
*Pour une installation manuelle: https://pad.p2p.legal/G1sms-install*
|
||||||
|
|
||||||
### Clonez le dépôt G1sms+
|
### Clonez le dépôt G1sms+
|
||||||
|
sudo apt update && sudo apt install git
|
||||||
git clone https://git.p2p.legal/axiom-team/G1sms
|
git clone https://git.p2p.legal/axiom-team/G1sms
|
||||||
mv G1sms G1sms+
|
mv G1sms G1sms+
|
||||||
cd G1sms+
|
cd G1sms+
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
usbserial=($(lsmod | grep -w usbserial | awk '{ print $4 }' | awk -F, '{ print $1 " " $2 }'))
|
||||||
|
|
||||||
|
|
||||||
|
sudo modprobe -r option
|
||||||
|
sudo modprobe -r usbserial
|
||||||
|
|
||||||
|
sudo modprobe option
|
||||||
|
sudo modprobe usbserial
|
||||||
|
|
||||||
|
#for i in "${usbserial[@]}"; do
|
||||||
|
#echo "tata: $i"
|
||||||
|
# sudo modprobe -r $i
|
||||||
|
# sudo modprobe $i
|
||||||
|
#done
|
||||||
|
|
||||||
|
|
||||||
|
exit 0
|
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
MY_PATH="`dirname \"$0\"`" # relative
|
||||||
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
|
|
||||||
|
[[ ! $1 ]] && echo "Veuillez choisir un niveau de log" && exit 1
|
||||||
|
|
||||||
|
sudo sed -i "/debuglevel/d" /etc/gammu-smsdrc
|
||||||
|
echo "debuglevel = $1" | sudo tee -a /etc/gammu-smsdrc
|
||||||
|
|
||||||
|
$MY_PATH/gammu-restart.sh
|
||||||
|
|
||||||
|
exit 0
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
PID=$(sudo ps auxf | grep "/usr/bin/gammu-smsd" | grep -v -E "color=auto|grep" | awk '{ print $2 }')
|
||||||
|
|
||||||
|
[[ $PID ]] && sudo kill -9 "$PID"
|
||||||
|
|
||||||
|
sudo service gammu-smsd restart
|
||||||
|
|
||||||
|
exit 0
|
34
install.sh
34
install.sh
|
@ -8,23 +8,35 @@ MY_PATH="`dirname \"$0\"`" # relative
|
||||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||||
init_loc="$MY_PATH/shell/init.sh"
|
init_loc="$MY_PATH/shell/init.sh"
|
||||||
now=$(date +%Y-%m-%d)
|
now=$(date +%Y-%m-%d)
|
||||||
|
unset err
|
||||||
|
|
||||||
|
## Récupère les données du profile
|
||||||
[[ -f $MY_PATH/.profile ]] && source $MY_PATH/.profile
|
[[ -f $MY_PATH/.profile ]] && source $MY_PATH/.profile
|
||||||
|
|
||||||
|
## Récupère les arguments
|
||||||
args="$@"
|
args="$@"
|
||||||
[[ $args =~ all ]] && repOption=o
|
[[ $args =~ all ]] && repOption=o
|
||||||
[[ $args =~ noptions ]] && repOption=n
|
[[ $args =~ noptions ]] && repOption=n
|
||||||
[[ $args =~ force ]] && force_req=o
|
[[ $args =~ force ]] && force_req=o
|
||||||
[[ $args =~ noask ]] && noask=o
|
[[ $args =~ noask ]] && noask=o
|
||||||
|
|
||||||
|
## Vérifie le type de système
|
||||||
|
[[ $(uname -a | grep arm) ]] && isARM=YES || unset isARM
|
||||||
|
if [[ $(grep -E 'stretch|18.|19.' /etc/os-release) ]]; then OS=stretch;
|
||||||
|
elif [[ $(grep buster /etc/os-release) ]]; then OS=buster;
|
||||||
|
else echo "${c_red}Votre OS n'est pas supporté$c_"; exit 1; fi
|
||||||
|
echo -e "$OS\n$isARM" > .install/.OS
|
||||||
|
|
||||||
unset err
|
unset err
|
||||||
|
|
||||||
|
## Vérifie si le script est en lancé par root
|
||||||
if [ "$EUID" -eq 0 ]
|
if [ "$EUID" -eq 0 ]
|
||||||
then echo -e "${c_red}Veuillez ne pas executez ce script en root. Choisissez un utilisateur pour votre serveur G1sms+ (nous recommandons l'utilisateur pi)$c_"
|
then echo -e "${c_red}Veuillez ne pas executez ce script en root. Choisissez un utilisateur pour votre serveur G1sms+ (nous recommandons l'utilisateur pi)$c_"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## Update G1sms+ code
|
## Update G1sms+ code
|
||||||
git pull || err=1
|
git pull || err+=1
|
||||||
|
|
||||||
chmod u+x $MY_PATH/.install/*.sh
|
chmod u+x $MY_PATH/.install/*.sh
|
||||||
|
|
||||||
|
@ -34,8 +46,8 @@ $MY_PATH/.install/export_colors.sh
|
||||||
## Vérifie si IPFS est installé
|
## Vérifie si IPFS est installé
|
||||||
if [[ $force_req == "o" || -z $(which ipfs) || -z $(which gammu) ]];then
|
if [[ $force_req == "o" || -z $(which ipfs) || -z $(which gammu) ]];then
|
||||||
echo -e "${c_yellow}IPFS ou gammu n'ont pas été détectés sur votre machine, nous allons installer tous les prérequis...$c_"
|
echo -e "${c_yellow}IPFS ou gammu n'ont pas été détectés sur votre machine, nous allons installer tous les prérequis...$c_"
|
||||||
$MY_PATH/.install/1-install_requirements.sh || err=1
|
$MY_PATH/.install/1-install_requirements.sh silkaj ipfs gammu || err+=1
|
||||||
$MY_PATH/.install/2-configure_ipfs_layer.sh || err=1
|
$MY_PATH/.install/2-configure_ipfs_layer.sh || err+=1
|
||||||
else
|
else
|
||||||
echo -e "${c_green}IPFS et gammu sont déjà installé !$c_"
|
echo -e "${c_green}IPFS et gammu sont déjà installé !$c_"
|
||||||
fi
|
fi
|
||||||
|
@ -59,7 +71,7 @@ if [[ -f $MY_PATH/.install/templates/init.sh ]]; then
|
||||||
[[ $noask != "o" ]] && echo -e "${c_light}${c_blue}LES PARAMETRES SONT BONS? Appliquer? ENTER ou CTRL-C ?$c_" && read
|
[[ $noask != "o" ]] && echo -e "${c_light}${c_blue}LES PARAMETRES SONT BONS? Appliquer? ENTER ou CTRL-C ?$c_" && read
|
||||||
|
|
||||||
[[ -f shell/init.sh ]] && mv shell/init.sh shell/init.sh.old
|
[[ -f shell/init.sh ]] && mv shell/init.sh shell/init.sh.old
|
||||||
cp $MY_PATH/.install/templates/init.sh shell/init.sh || err=1
|
cp $MY_PATH/.install/templates/init.sh shell/init.sh || err+=1
|
||||||
|
|
||||||
sed -i s/pi/$YOU/g $init_loc
|
sed -i s/pi/$YOU/g $init_loc
|
||||||
sed -i s/+33600000000/$MASTERPHONE/g $init_loc
|
sed -i s/+33600000000/$MASTERPHONE/g $init_loc
|
||||||
|
@ -68,7 +80,7 @@ if [[ -f $MY_PATH/.install/templates/init.sh ]]; then
|
||||||
sed -i s/Fred/$ADMINPSEUDO/g $init_loc
|
sed -i s/Fred/$ADMINPSEUDO/g $init_loc
|
||||||
else
|
else
|
||||||
echo -e "${c_red}init.sh introuvable...$c_"
|
echo -e "${c_red}init.sh introuvable...$c_"
|
||||||
err=1
|
err+=1
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -76,13 +88,15 @@ fi
|
||||||
|
|
||||||
repOld=$repOption
|
repOld=$repOption
|
||||||
[[ -z $repOption ]] && echo -e "${c_yellow}Voulez-vous installer les modules complémentaires de copylaradio ? (o/n)$c_" && read repOption
|
[[ -z $repOption ]] && echo -e "${c_yellow}Voulez-vous installer les modules complémentaires de copylaradio ? (o/n)$c_" && read repOption
|
||||||
[[ $repOption =~ ^(o|1|yes|options|a|all)$ ]] && .install/3-install_copylaradio.sh; repOption=$repOld
|
if [[ $repOption =~ ^(o|1|yes|options|a|all)$ ]]; then $MY_PATH/.install/3-install_copylaradio.sh || err+=1; fi; repOption=$repOld
|
||||||
[[ -z $repOption ]] && echo -e "${c_yellow}Voulez-vous installer l'interface web playSMS ? (o/n)$c_" && read repOption
|
[[ -z $repOption ]] && echo -e "${c_yellow}Voulez-vous installer l'interface web Kalkun ? (o/n)$c_" && read repOption
|
||||||
[[ $repOption =~ ^(o|1|yes|options|a|all)$ ]] && .install/4-install_playsms.sh; repOption=$repOld
|
if [[ $repOption =~ ^(o|1|yes|options|a|all)$ ]]; then isKalkun=1; $MY_PATH/.install/4a-install_kalkun.sh || err+=1; fi; repOption=$repOld
|
||||||
|
[[ -z $repOption && -z $isKalkun ]] && echo -e "${c_yellow}Voulez-vous installer l'interface web playSMS ? (o/n)$c_" && read repOption
|
||||||
|
if [[ $repOption =~ ^(o|1|yes|options|a|all)$ ]]; then $MY_PATH/.install/4b-install_playsms.sh || err+=1; fi; repOption=$repOld
|
||||||
|
|
||||||
if [[ $err ]]; then
|
if [[ $err ]]; then
|
||||||
echo -e "---\n${c_red}L'installation n'est mal déroulé =($c_"
|
echo -e "---\n${c_red}L'installation générale n'est mal déroulé =($c_"
|
||||||
else
|
else
|
||||||
echo -e "---\n${c_green}L'installation de votre noeud G1SMS est terminé !\nBienvenue à bord =)$c_"
|
echo -e "---\n${c_green}Félécitation ! L'installation de votre noeud G1SMS s'est terminé avec succès !\nBienvenue à bord =)$c_"
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue