forked from OpenRepeater/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openrepeater-debian-embedded-pkg-install.sh
828 lines (676 loc) · 23.8 KB
/
openrepeater-debian-embedded-pkg-install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
#!/bin/bash
############################
#Date June 20, 2015 20:34 CST
############################
#
# Open Repeater Project
#
# Copyright (C) <2015> <Richard Neese>
#
# 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 3 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, see <http://www.gnu.org/licenses/gpl-3.0.en.html>
#
######################################
# Auto Install Configuration options
######################################
# ----- Start Edit Here ----- #
####################################################
# Repeater call sign
# Please change this to match the repeater call sign
####################################################
# CALL SIGN
cs="Set This"
######################################################################
# Setup up host / domain name or use system default host/domain name.
######################################################################
set_hndn="y"
#############################################################
# If you use the set host name please change these to fields.
# Please change this to match you host and domain ........
#############################################################
# HOST Name
hn="repeater"
# DOMAIN Name
dn="mydomain.com"
########################################################################################
# Configure wan (wide area network) (internet interface) Networking
# IF you machine is at its final install location and needs/requires a static ip
# Change this setting from n to y to enable network setup of eth0.
# Other Wise by default it uses dhcp an the ip will be dynamic wich could lead to issues.
#########################################################################################
set_wan_static="n"
###############################################################
# If you change set_wan_static=y Please chane these to configure eth0:
# Make shure they match your current working network.......
###############################################################
#Iinterface ip
ip="0.0.0.0"
# Interface Netmask 255.xxx.xxx.xxx 255.255.255.xxx
nm="0.0.0.0"
# Interface Gateway
gw="0.0.0.0"
# Interface Name Servers
ns1="0.0.0.0"
ns2="0.0.0.0"
########################################################
# Set mp3/wav file upload/post size limit for php/nginx
# ( Must Have the M on the end )
########################################################
upload_size="25M"
######################################
#set up odroid repo for odroid boards
######################################
odroid_boards="n"
###########################################
# Use for configuring beaglebone arm boards
# Disable Default Web Service
###########################################
beaglebone_boards="n"
###########################################
# Use for configuring beaglebone arm boards
# Disable Default Web Service
###########################################
raspi2_boards="n"
################################################################
# Install Ajenti Optional Admin Portal (Optional) (Not Required)
# (Currently broken on beaglebone installs)
################################################################
install_ajenti="n"
####################################################
# Install vsftpd for devel (Optional) (Not Required)
####################################################
install_vsftpd="n"
#####################
# set vsftp user name
#####################
vsftpd_user=""
########################
# set vsftp config path
########################
FTP_CONFIG_PATH="/etc/vsftpd.conf"
# ----- Stop Edit Here ------- #
#######################
# Nginx default www dir
#######################
WWW_PATH="/var/www"
#################################
#set Web User Interface Dir Name
#################################
gui_name="openrepeater"
#####################
#Php ini config file
#####################
php_ini="/etc/php5/fpm/php.ini"
##################################################################
# check to confirm running as root. # First, we need to be root...
##################################################################
if [ "$(id -u)" -ne "0" ]; then
sudo -p "$(basename "$0") must be run as root, please enter your sudo password : " "$0" "$@"
exit 0
fi
echo
echo "Looks Like you are root.... continuing!"
echo
###############################################
#if lsb_release is not installed it installs it
###############################################
if [ ! -s /usr/bin/lsb_release ]; then
apt-get update && apt-get -y install lsb-release
fi
#################
# Os/Distro Check
#################
lsb_release -c |grep -i jessie &> /dev/null 2>&1
if [ $? -eq 0 ]; then
echo " OK you are running Debian 8 : Jessie "
else
echo " This script was written for Debian 8 Jessie "
echo
echo " Your OS appears to be: " lsb_release -a
echo
echo " Your OS is not currently supported by this script ... "
echo
echo " Exiting the install. "
exit
fi
###########################################
# Run a OS and Platform compatabilty Check
###########################################
########
# ARMEL
########
case $(uname -m) in armv[4-6]l)
echo
echo " ArmEL is currenty UnSupported "
echo
exit
esac
########
# ARMHF
########
case $(uname -m) in armv[7-9]l)
echo
echo " ArmHF arm v7 v8 v9 boards supported "
echo
esac
#############
# Intel/AMD
#############
case $(uname -m) in x86_64|i[4-6]86)
echo
echo " Intel / Amd boards currently UnSupported"
echo
exit
esac
echo
#################################################################################################
# Setting apt_get to use the httpredirecter to get
# To have <APT> automatically select a mirror close to you, use the Geo-ip redirector in your
# sources.list "deb http://httpredir.debian.org/debian/ jessie main".
# See http://httpredir.debian.org/ for more information. The redirector uses HTTP 302 redirects
# not dnS to serve content so is safe to use with Google dnS.
# See also <which httpredir.debian.org>. This service is identical to http.debian.net.
#################################################################################################
echo "installing jessie release repo"
cat > "/etc/apt/sources.list" << DELIM
deb http://httpredir.debian.org/debian/ jessie main contrib non-free
deb-src http://httpredir.debian.org/debian/ jessie main contrib non-free
deb http://httpredir.debian.org/debian/ jessie-updates main contrib non-free
deb-src http://httpredir.debian.org/debian/ jessie-updates main contrib non-free
deb http://httpredir.debian.org/debian/ jessie-backports main contrib non-free
deb-src http://httpredir.debian.org/debian/ jessie-backports main contrib non-free
DELIM
##########################
# Adding OpenRepeater Repo
##########################
echo " Installing OpenRepeater repo "
echo " svxlink & openrepeater pkgs "
cat > "/etc/apt/sources.list.d/openrepeater.list" <<DELIM
deb http://repo.openrepeater.com/openrepeater/release/debian/ jessie main
DELIM
######################
#Update base os
######################
for i in update upgrade ;do apt-get -y "${i}" ; done
apt-get autoclean
###################
#odroid extra repo
###################
if [[ $odroid_boards == "y" ]]; then
cat >> "/etc/apt/sources.list.d/odroid.list" << DELIM
#deb http://deb.odroid.in/c1/ trusty main
deb http://deb.odroid.in/ trusty main
DELIM
apt-get update
fi
#########################
#beagle bone extra repo
#########################
if [[ $beaglebone_boards == "y" ]]; then
cat >> "/etc/apt/sources.list.d/beaglebone.list" << DELIM
deb [arch=armhf] http://repos.rcn-ee.net/debian/ jessie main
#deb-src [arch=armhf] http://repos.rcn-ee.net/debian/ jessie main
DELIM
apt-get update
fi
#########################
#raspi2 repo
#########################
if [[ $raspi2_boards == "y" ]]; then
cat >> "/etc/apt/sources.list.d/raspi2.list" << DELIM
deb [trusted=yes] https://repositories.collabora.co.uk/debian/ jessie rpi2
DELIM
apt-get update
fi
###################
# Notes / Warnings
###################
echo
cat << DELIM
Not Ment For L.a.m.p Installs
L.A.M.P = Linux Apache Mysql PHP
THIS IS A ONE TIME INSTALL SCRIPT
IT IS NOT INTENDED TO BE RUN MULTIPLE TIMES
This Script Is Ment To Be Run On A Fresh Install Of
Debian 8 (Jessie)
If It Fails For Any Reason Please Report To kb3vgw@gmail.com
Please Include Any Screen Output You Can To Show Where It Fails
DELIM
###########################
# Pre-Install Information
###########################
echo
cat << DELIM
Note:
Pre-Install Information:
This script uses Sqlite by default .
DELIM
echo
###############################################################################################
#Testing for internet connection. Pulled from and modified
#http://www.linuxscrew.com/2009/04/02/tiny-bash-scripts-check-internet-connection-availability/
###############################################################################################
echo
echo "This Script Currently Requires a internet connection "
echo
wget -q --tries=10 --timeout=5 http://www.google.com -O /tmp/index.google &> /dev/null
if [ ! -s /tmp/index.google ];then
echo "No Internet connection. Please check ethernet cable"
/bin/rm /tmp/index.google
exit 1
else
echo "I Found the Internet ... continuing!!!!!"
/bin/rm /tmp/index.google
fi
echo
printf ' Current ip is : '; ip -f inet addr show dev eth0 | sed -n 's/^ *inet *\([.0-9]*\).*/\1/p'
echo
######################
#Install Dependancies
#####################
echo " Installing install deps "
apt-get install -y --force-yes memcached sqlite3 libopus0 alsa-utils vorbis-tools sox libsox-fmt-mp3 librtlsdr0 \
minicom ntp libasound2 libspeex1 libgcrypt20 libpopt0 libgsm1 tcl8.6 alsa-base bzip2 \
sudo svxlink-server remotetrx
apt-get autoclean
cd /usr/share/svxlink/sounds
wget https://github.com/sm0svx/svxlink-sounds-en_US-heather/releases/download/14.08/svxlink-sounds-en_US-heather-16k-13.12.tar.bz2
tar xjvf svxlink-sounds-en_US-heather-16k-13.12.tar.bz2
mv en_US-heather* en_US
cd /root
##############################
#Set a reboot if Kernel Panic
##############################
cat > /etc/sysctl.conf << DELIM
kernel.panic = 10
DELIM
####################################
# Set fs to run in a tempfs ramdrive
####################################
cat >> /etc/fstab << DELIM
tmpfs /tmp tmpfs defaults 0 0
tmpfs /var/tmp tmpfs defaults 0 0
DELIM
# ####################################
# DISABLE BEAGLEBONE 101 WEB SERVICES
# ####################################
if [[ $beaglebone_boards == "y" ]]; then
echo " Disabling The Beaglebone 101 web services "
systemctl disable cloud9.service
systemctl disable gateone.service
systemctl disable bonescript.service
systemctl disable bonescript.socket
systemctl disable bonescript-autorun.service
systemctl disable avahi-daemon.service
systemctl disable gdm.service
systemctl disable mpd.service
echo " Stoping The Beaglebone 101 web services "
systemctl stop cloud9.service
systemctl stop gateone.service
systemctl stop bonescript.service
systemctl stop bonescript.socket
systemctl stop bonescript-autorun.service
systemctl stop avahi-daemon.service
systemctl stop gdm.service
systemctl stop mpd.service
cat >> /boot/uEnv.txt << DELIM
#Disable HDMI sound
optargs=capemgr.disable_partno=BB-BONELT-HDMI
DELIM
apt-get -y autoremove apache2*
fi
##########################################
#---Start of nginx / php5 install --------
###########################################
apt-get -y install ssl-cert nginx php5-cli php5-common php-apc php5-gd php-db php5-fpm php5-memcache php5-sqlite
apt-get autoclean
##################################################
# Changing file upload size from 2M to upload_size
##################################################
sed -i "$php_ini" -e "s#upload_max_filesize = 2M#upload_max_filesize = $upload_size#"
######################################################
# Changing post_max_size limit from 8M to upload_size
######################################################
sed -i "$php_ini" -e "s#post_max_size = 8M#post_max_size = $upload_size#"
#####################################################################################################
#Nginx config Copied from Debian nginx pkg (nginx on debian wheezy uses sockets by default not ports)
#####################################################################################################
cat > "/etc/nginx/sites-available/$gui_name" << DELIM
server{
listen 127.0.0.1:80;
server_name 127.0.0.1;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
client_max_body_size 25M;
client_body_buffer_size 128k;
root /var/www/openrepeater;
index index.php;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
}
# Disable viewing .htaccess & .htpassword & .db
location ~ .htaccess {
deny all;
}
location ~ .htpassword {
deny all;
}
location ~^.+.(db)$ {
deny all;
}
}
server{
listen 443;
listen [::]:443 default_server ipv6only=on;
include snippets/snakeoil.conf;
ssl on;
root /var/www/openrepeater;
index index.php;
server_name $gui_name;
location / {
try_files \$uri \$uri/ =404;
}
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME /var/www/openrepeater/\$fastcgi_script_name;
}
# Disable viewing .htaccess & .htpassword & .db
location ~ .htaccess {
deny all;
}
location ~ .htpassword {
deny all;
}
location ~^.+.(db)$ {
deny all;
}
}
DELIM
###############################################
# set nginx worker level limit for performance
###############################################
cat > "/etc/nginx/nginx.conf" << DELIM
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
open_file_cache max=1000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors off;
fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=microcache:15M max_size=1000m inactive=60m;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_static on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
DELIM
##############################################################
# linking fusionpbx nginx config from avaible to enabled sites
##############################################################
ln -s /etc/nginx/sites-available/"$gui_name" /etc/nginx/sites-enabled/"$gui_name"
######################
#disable default site
######################
rm -rf /etc/nginx/sites-enabled/default
# Make sure the path /var/www/ is owned by your web server user:
chown -R www-data:www-data /var/www
##############################
#Restarting Nginx and PHP FPM
##############################
for i in nginx php5-fpm ;do service "${i}" restart > /dev/null 2>&1 ; done
#################################################
# Fetch and Install open repeater project web ui
# ################################################
mkdir $WWW_PATH/$gui_name
apt-get install -y --force-yes openrepeater
find "$WWW_PATH" -type d -exec chmod 775 {} +
find "$WWW_PATH" -type f -exec chmod 664 {} +
chown -R www-data:www-data $WWW_PATH
cp /etc/default/svxlink /etc/default/svxlink.orig
cat > "/etc/default/svxlink" << DELIM
#############################################################################
#
# Configuration file for the SvxLink startup script /etc/init.d/svxlink
#
#############################################################################
# The log file to use
LOGFILE=/var/log/svxlink
# The PID file to use
PIDFILE=/var/run/svxlink.pid
# The user to run the SvxLink server as
RUNASUSER=svxlink
# Specify which configuration file to use
CFGFILE=/etc/openrepeater/svxlink/svxlink.conf
# Environment variables to set up. Separate variables with a space.
ENV="ASYNC_AUDIO_NOTRIGGER=1"
# GPIO_PTT_PIN=<num>
# <num> defines the GPIO pin used for PTT.
# GPIO_SQL_PIN=<num>
# <num> defines the GPIO pin used for Squelch.
#GPIO_PTT_PIN=
#GPIO_SQL_PIN=
#uesd for openrepeater to get gpio pins
if [ -r /etc/openrepeater/svxlink/svxlink_gpio.conf ]; then
. /etc/openrepeater/svxlink/svxlink_gpio.conf
fi
DELIM
mv /etc/default/remotetrx /etc/default/remotetrx.orig
cat > "/etc/default/remotetrx" << DELIM
#############################################################################
#
# Configuration file for the RemoteTrx startup script /etc/init.d/remotetrx
#
#############################################################################
# The log file to use
LOGFILE=/var/log/remotetrx
# The PID file to use
PIDFILE=/var/run/remotetrx.pid
# The user to run the SvxLink server as
RUNASUSER=svxlink
# Specify which configuration file to use
CFGFILE=/etc/openrepeater/svxlink/remotetrx.conf
# Environment variables to set up. Separate variables with a space.
ENV="ASYNC_AUDIO_NOTRIGGER=1"
DELIM
#making links...
ln -s /usr/share/openrepeater/sounds/courtesy_tones /var/www/openrepeater/courtesy_tones
ln -s /etc/openrepeater/svxlink/local-events.d/ /usr/share/svxlink/events.d/local
ln -s /var/log/svxlink /var/www/openrepeater/log
chown www-data:www-data /var/www/openrepeater/courtesy_tones
cp -rp /usr/share/examples/openrepeater/install/svxlink/* /etc/openrepeater/svxlink
cp -rp /usr/share/examples/openrepeater/install/sql/openrepeater.db /var/lib/openrepeater/db
cp -rp /usr/share/examples/openrepeater/install/sql/database.php /etc/openrepeater
chown -R www-data:www-data /var/lib/openrepeater /etc/openrepeater
#########################
#restart svxlink service
#########################
service svxlink restart
#################
# Configure Sudo
#################
cat > "/usr/local/bin/svxlink_restart" << DELIM
#!/bin/bash
SERVICE=svxlink
ps -u \$SERVICE | grep -v grep | grep \$SERVICE > /dev/null
result=\$?
echo "exit code: \${result}"
if [ "\${result}" -eq "0" ] ; then
echo "\$(date): \$SERVICE service running"
echo "\$(date): Restarting svxlink service with updated configuration"
sudo service svxlink try-restart
else
echo "\$(date): \$SERVICE is not running"
echo "\$(date): Starting svxlink up with first time new configuration"
sudo service svxlink start
fi
DELIM
cat > "/usr/local/bin/svxlink_stop" << DELIM
#!/bin/bash
SERVICE=svxlink
ps -u \$SERVICE | grep -v grep | grep \$SERVICE > /dev/null
result=\$?
echo "exit code: \${result}"
if [ "\${result}" -eq "0" ] ; then
echo "\$(date): \$SERVICE service running, Stopping svxlink service"
sudo svxlink stop
else
echo "\$(date): \$SERVICE is not running"
fi
DELIM
cat > "/usr/local/bin/svxlink_start" << DELIM
#!/bin/bash
SERVICE=svxlink
ps -u \$SERVICE | grep -v grep | grep \$SERVICE > /dev/null
result=\$?
echo "exit code: \${result}"
if [ "\${result}" -eq "0" ] ; then
echo "\$(date): \$SERVICE service running, all is fine"
else
echo "\$(date): \$SERVICE is not running"
echo "\$(date): Atempting to start svxlink"
sudo service svxlink start
fi
DELIM
cat > "/usr/local/bin/repeater_reboot" << DELIM
#!/bin/bash
sudo -u www-data /sbin/reboot
DELIM
sudo chown root:www-data /usr/local/bin/svxlink_restart /usr/local/bin/svxlink_start /usr/local/bin/svxlink_stop /usr/local/bin/repeater_reboot
sudo chmod 550 /usr/local/bin/svxlink_restart /usr/local/bin/svxlink_start /usr/local/bin/svxlink_stop /usr/local/bin/repeater_reboot
cat >> /etc/sudoers << DELIM
#allow www-data to access amixer and service
www-data ALL=(ALL) NOPASSWD: /usr/local/bin/svxlink_restart, NOPASSWD: /usr/local/bin/svxlink_start, NOPASSWD: /usr/local/bin/svxlink_stop, NOPASSWD: /usr/local/bin/repeater_reboot
DELIM
#########################################################
#-----Installing Fail2Ban/monit Protection services------
#########################################################
for i in fail2ban monit ;do apt-get -y install "${i}" ; done
###############################################
# INSTALL FTP SERVER / ADD USER FOR DEVELOPMENT
###############################################
if [[ $install_vsftpd == "y" ]]; then
apt-get install vsftpd
edit_config $FTP_CONFIG_PATH anonymous_enable NO enabled
edit_config $FTP_CONFIG_PATH local_enable YES enabled
edit_config $FTP_CONFIG_PATH write_enable YES enabled
edit_config $FTP_CONFIG_PATH local_umask 022 enabled
cat "force_dot_files=YES" >> "$FTP_CONFIG_PATH"
system vsftpd restart
# ############################
# ADD FTP USER & SET PASSWORD
# ############################
adduser $vsftpd_user
fi
#############################
#Install Ajenti Admin Portal
#############################
if [[ $install_ajenti == "y" ]]; then
##########################
#ADD Ajenti repo & ajenti
##########################
echo "Installing Ajenti Admin Portal"
cat > "/etc/apt/sources.list.d/ajenti.list" <<DELIM
deb http://repo.ajenti.org/debian main main debian
DELIM
######################
# add ajenti repo key
######################
wget http://repo.ajenti.org/debian/key -O- | apt-key add -
#################
# install ajenti
#################
apt-get update
apt-get install -y ajenti task openvpn supervisor python-memcache python-beautifulsoup cron
fi
#############################
#Setting Host/Domain name
#############################
if [[ $set_hndn == "y" ]]; then
cat << EOF > /etc/hostname
$cs-$hn
EOF
fi
#########################################
# Setup Primary Network Interface (WLAN)
#########################################
if [[ $set_wan_static == "y" ]]; then
cat << EOF > /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address $ip
netmask $nm
gateway $gw
dns-nameservers $ns1 $ns2
EOF
#################
#Setup /etc/hosts
#################
cat << EOF > /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
$ip $hn.$dn
$ip $hn.$dn $dn
EOF
fi
echo " You will need to edit the php.ini file and add extensions=memcache.so "
echo " location : /etc/php5/fpm/php.ini and then restart web service "
echo " ########################################################################################## "
echo " # The Open Repeater Project / SVXLink / Echo link server Install is now complete # "
echo " # and your system is ready for use.. # "
echo " # # "
echo " # Please send any feed back to kb3vgw@gmail.com # "
echo " ########################################################################################## "