forked from SlaSerX/stalker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
root
committed
Dec 19, 2018
1 parent
4b5601c
commit 3df8164
Showing
4 changed files
with
225 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
#!/bin/bash | ||
|
||
# Stalker WM Portal Ministra road warrior installer for Debian, Ubuntu | ||
|
||
# This script will work on Debian, Ubuntu and probably other distros | ||
# of the same families, although no support is offered for them. It isn't | ||
# bulletproof but it will probably work if you simply want to setup a Stalker WM Portal on | ||
# your Debian/Ubuntu box. It has been designed to be as unobtrusive and | ||
# universal as possible. | ||
|
||
# This is a free shell script under GNU GPL version 3.0 or above | ||
# Copyright (C) 2017 LinuxHelps project. | ||
# Feedback/comment/suggestions : https://linuxhelps.net/ | ||
# Author Ivan Bachvarov a.k.a SlaSerX | ||
|
||
|
||
# Color schema | ||
|
||
red='\033[01;31m' | ||
blue='\033[01;34m' | ||
green='\033[01;32m' | ||
norm='\033[00m' | ||
|
||
# Temporary colors | ||
RED="$(tput setaf 1)" | ||
YELLOW="$(tput setaf 3)" | ||
CYAN="$(tput setaf 6)" | ||
NORMAL="$(tput sgr0)" | ||
|
||
# smallLoader colors | ||
|
||
CSI="\033[" | ||
CEND="${CSI}0m" | ||
CRED="${CSI}1;31m" | ||
CGREEN="${CSI}1;32m" | ||
CYELLOW="${CSI}1;33m" | ||
CPURPLE="${CSI}1;35m" | ||
CCYAN="${CSI}1;36m" | ||
CBROWN="${CSI}0;33m" | ||
|
||
# smallLoader | ||
|
||
smallLoader() { | ||
echo "" | ||
echo "" | ||
echo -ne '[ + + + ] 3s \r' | ||
sleep 1 | ||
echo -ne '[ + + + + + + ] 2s \r' | ||
sleep 1 | ||
echo -ne '[ + + + + + + + + + ] 1s \r' | ||
sleep 1 | ||
echo -ne '[ + + + + + + + + + ] Press [Enter] to continue... \r' | ||
echo -ne '\n' | ||
|
||
read -r | ||
} | ||
|
||
|
||
|
||
VER="5.5.0" | ||
PRODUCT="Ministra Portal" | ||
WEB="http://`ip route get 8.8.8.8 | awk '{print $NF; exit}'`/stalker_portal" | ||
WAN="`wget -q -O - http://icanhazip.com/ | tail`" | ||
LOCAL="`ip route get 8.8.8.8 | awk '{print $NF; exit}'`" | ||
|
||
supported=" Debian 8, 9 on i386 and amd64 | ||
Ubuntu 16.04" | ||
|
||
skipyesno=0 | ||
|
||
# Ask a yes or no question | ||
# if $skipyesno is 1, always Y | ||
# if NONINTERACTIVE environment variable is 1, always Y | ||
yesno () { | ||
# XXX skipyesno is a global set in the calling script | ||
# shellcheck disable=SC2154 | ||
if [ "$skipyesno" = "1" ]; then | ||
return 0 | ||
fi | ||
if [ "$NONINTERACTIVE" = "1" ]; then | ||
return 0 | ||
fi | ||
while read -r line; do | ||
case $line in | ||
y|Y|Yes|YES|yes|yES|yEs|YeS|yeS) return 0 | ||
;; | ||
n|N|No|NO|no|nO) return 1 | ||
;; | ||
*) | ||
printf "\n${YELLOW}Please enter ${CYAN}[y]${YELLOW} or ${CYAN}[n]${YELLOW}:${NORMAL} " | ||
;; | ||
esac | ||
done | ||
} | ||
|
||
install_msg() { | ||
cat <<EOF | ||
Welcome to the ${RED}$PRODUCT${NORMAL} installer, version ${RED}$VER${NORMAL} | ||
This script must be run on a freshly installed supported OS. It does not | ||
perform updates or upgrades (use your system package manager). | ||
The systems currently supported by install.sh are: | ||
EOF | ||
echo "${CYAN}$supported${NORMAL}" | ||
cat <<EOF | ||
If your OS/version/arch is not listed, installation ${RED}will fail${NORMAL}. More | ||
details about the systems supported by the script can be found here: | ||
${UNDERLINE}${CYAN}https://github.com/SlaSerX/stalker/blob/master/docs/os-suport${NORMAL} | ||
EOF | ||
|
||
printf " Continue? (y/n) " | ||
if ! yesno; then | ||
exit | ||
fi | ||
} | ||
|
||
if [ "$skipyesno" -ne 1 ] && [ -z "$setup_only" ]; then | ||
install_msg | ||
fi | ||
|
||
|
||
# | ||
|
||
pass="st@lk3r" | ||
source="http://linuxhelps.net/configs" | ||
|
||
# Install Necessary services & packets | ||
sudo apt-get install -y -u apache2 php php-soap python2.7 nginx nginx-extras | ||
|
||
sleep 1 | ||
|
||
# Apache & Nginx config | ||
a2enmod rewrite | ||
apt-get purge libapache2-mod-php5filter > /dev/null | ||
phpenmod mcrypt | ||
cd /etc/apache2/sites-enabled/ | ||
rm -rf * | ||
wget $source/000-default.conf | ||
cd /etc/apache2/ | ||
rm -rf ports.conf | ||
wget $source/ports.conf | ||
cd /etc/nginx/sites-available/ | ||
rm -rf default | ||
wget $source/other/default | ||
/etc/init.d/apache2 restart | ||
/etc/init.d/nginx restart | ||
sleep 1 | ||
|
||
apt-get update | ||
|
||
sleep 1 | ||
|
||
# Set the Server Timezone to CST | ||
echo "Europe/Sofia" > /etc/timezone | ||
dpkg-reconfigure -f noninteractive tzdata | ||
|
||
# Download Ministra | ||
cd /var/www/html/ | ||
wget http://lab.itbox.bg/software/tv/ministra-5.5.0.zip | ||
unzip ministra-5.5.0.zip | ||
rm -rf *.zip | ||
|
||
# Create directories and set permission 0777 to them. | ||
|
||
mkdir -p -m 0777 /media/raid0/storage /media/raid0/karaoke /media/raid0/records /media/raid0/mac | ||
|
||
# Create a directory /var/www/media/ | ||
|
||
mkdir /var/www/media | ||
|
||
# Create a symbolic link to the STB's home directories in /var/www/media/ | ||
|
||
ln -s /media/raid0/mac/ /var/www/media/storage | ||
|
||
# Enable recording for “TV Archive” function it is necessary to run next command in | ||
|
||
cd /var/www/html/stalker_portal/storage/ | ||
chmod a+x install.sh | ||
./install.sh | ||
|
||
sleep 1 | ||
sl | ||
sleep 1 | ||
|
||
echo "" | ||
echo -e "${CCYAN}-----------------------------------------------------------------------${CEND}" | ||
echo "" | ||
echo -e "${CCYAN}[ Install Storage Server Complete ]${CEND}" | ||
echo "" | ||
echo -e "${CEND}" | ||
echo -e "Edit File : ${CGREEN}/var/www/stalker_portal/storage/config.php ${CEND}" | ||
echo "" | ||
echo -e "${CCYAN}-----------------------------------------------------------------------${CEND}" | ||
echo "" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters