Skip to content

Commit

Permalink
Script Upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Dec 19, 2018
1 parent 4b5601c commit 3df8164
Show file tree
Hide file tree
Showing 4 changed files with 225 additions and 5 deletions.
19 changes: 16 additions & 3 deletions install
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
# Author Ivan Bachvarov a.k.a SlaSerX


#Let's Encrypt Repository

apt install software-properties-common -y
yes | add-apt-repository ppa:certbot/certbot

#Update and Upgrade
echo "Updating and Upgrading"
apt-get update && sudo apt-get upgrade -y
Expand All @@ -22,7 +27,8 @@ apt-get update && sudo apt-get upgrade -y
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

sudo apt-get install -y dialog wget curl nano sudo unzip
sudo apt-get install -y dialog wget curl nano sudo unzip sl ccze lolcat software-properties-common python-certbot-nginx

chmod +x ./lab/*
(
c=20
Expand All @@ -47,7 +53,8 @@ else
options=(1 "Install Ministra Portal" off # any option can be set to default to "on"
2 "Install Stalker Portal" off
3 "Install Ministra on Ubuntu 16.04" off
4 "Exit" off)
4 "Install of the Storage Server" off
5 "Exit" off)
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
clear
for choice in $choices
Expand All @@ -70,8 +77,14 @@ else
./lab/ubuntu16
;;

#Exit
4)
# Install of the Storage Server
echo "Install of the Storage Server"
./lab/storage
;;

#Exit
5)
exit
;;

Expand Down
2 changes: 1 addition & 1 deletion lab/ministra
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ smallLoader() {



VER="5.4.0"
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`"
Expand Down
203 changes: 203 additions & 0 deletions lab/storage
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 ""


6 changes: 5 additions & 1 deletion lab/ubuntu16
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pass="st@lk3r"
source="http://linuxhelps.net/configs"

# Install Necessary services & packets
sudo apt-get -y -u install nginx memcached php php-mcrypt php-mysql php-pear nodejs libapache2-mod-php
sudo apt-get -y -u install nginx-full memcached php php-mcrypt php-mysql php-pear nodejs libapache2-mod-php
sleep 1

# Apache & Nginx config
Expand Down Expand Up @@ -213,6 +213,10 @@ sudo phing
sleep 1
smallLoader

sleep 1
sl
sleep 1

echo ""
echo -e "${CCYAN}-----------------------------------------------------------------------${CEND}"
echo ""
Expand Down

0 comments on commit 3df8164

Please sign in to comment.