forked from norman/fusionpbx-install.sh-github-mirror
Initial permission changes
added use of getopt to allow command line options to indicate to use different sources added +x
This commit is contained in:
70
debian/install.sh
vendored
Normal file → Executable file
70
debian/install.sh
vendored
Normal file → Executable file
@@ -1,29 +1,78 @@
|
||||
#!/bin/sh
|
||||
|
||||
#Process command line options
|
||||
OPTS=`getopt -n 'install.sh' -o h -l help,use-freeswitch-source,use-freeswitch-package-all,use-freeswitch-master -- "$@"`
|
||||
eval set -- "$OPTS"
|
||||
|
||||
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
|
||||
|
||||
USE_FREESWITCH_SOURCE=false
|
||||
USE_FREESWITCH_PACKAGE_ALL=false
|
||||
USE_FREESWITCH_MASTER=false
|
||||
HELP=false
|
||||
|
||||
while true; do
|
||||
case "$1" in
|
||||
--use-freeswitch-source ) USE_FREESWITCH_SOURCE=true; shift ;;
|
||||
--use-freeswitch-package-all ) USE_FREESWITCH_PACKAGE_ALL=true; shift ;;
|
||||
--use-freeswitch-master ) USE_FREESWITCH_MASTER=true; shift ;;
|
||||
-h | --help ) HELP=true; shift ;;
|
||||
-- ) shift; break ;;
|
||||
* ) break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ $HELP = true ]; then
|
||||
echo "Debian installer script"
|
||||
echo " --use-freeswitch-source will use freeswitch from source rather than (default:packages)"
|
||||
echo " --use-freeswitch-package-all if using packages use the meta-all package"
|
||||
echo " --use-freeswitch-master will use master branch/packages instead of (default:stable)"
|
||||
exit;
|
||||
fi
|
||||
|
||||
#Update Debian
|
||||
echo "Update Debian"
|
||||
apt-get upgrade && apt-get update -y --force-yes
|
||||
|
||||
#IPTables
|
||||
resources/./iptables.sh
|
||||
resources/iptables.sh
|
||||
|
||||
#FusionPBX
|
||||
resources/./fusionpbx.sh
|
||||
resources/fusionpbx.sh
|
||||
|
||||
#NGINX web server
|
||||
resources/./nginx.sh
|
||||
resources/nginx.sh
|
||||
|
||||
#Fail2ban
|
||||
resources/./fail2ban.sh
|
||||
resources/fail2ban.sh
|
||||
|
||||
#FreeSWITCH
|
||||
resources/switch/./package-release.sh
|
||||
#resources/switch/./package-master.sh
|
||||
#resources/switch/./source-release.sh
|
||||
resources/switch/./package-permissions.sh
|
||||
if [ $USE_FREESWITCH_SOURCE = true ]; then
|
||||
if [ $USE_FREESWITCH_MASTER = true ]; then
|
||||
resources/switch/source-master.sh
|
||||
else
|
||||
resources/switch/source-release.sh
|
||||
fi
|
||||
resources/switch/source-permissions.sh
|
||||
else
|
||||
if [ $USE_FREESWITCH_MASER = true ]; then
|
||||
if [ $USE_FREESWITCH_PACKAGE_ALL = true ]; then
|
||||
resources/switch/package-master-all.sh
|
||||
else
|
||||
resources/switch/package-master.sh
|
||||
fi
|
||||
else
|
||||
if [ $USE_FREESWITCH_PACKAGE_ALL = true ]; then
|
||||
resources/switch/package-all.sh
|
||||
else
|
||||
resources/switch/package-release.sh
|
||||
fi
|
||||
fi
|
||||
resources/switch/package-permissions.sh
|
||||
fi
|
||||
|
||||
#Postgres
|
||||
resources/./postgres.sh
|
||||
resources/postgres.sh
|
||||
|
||||
#set the ip address
|
||||
server_address=$(hostname -I)
|
||||
@@ -32,10 +81,9 @@ server_address=$(hostname -I)
|
||||
/bin/systemctl daemon-reload
|
||||
/bin/systemctl try-restart freeswitch
|
||||
/bin/systemctl daemon-reload
|
||||
/bin/systemctl restart php-fpm
|
||||
/bin/systemctl restart nginx
|
||||
/bin/systemctl restart fail2ban
|
||||
#/usr/sbin/service nginx restart
|
||||
#/usr/sbin/service fail2ban restart
|
||||
|
||||
#Show database password
|
||||
echo "Complete the install by by going to the IP address of this server ";
|
||||
|
||||
Reference in New Issue
Block a user