Skip to content
Snippets Groups Projects
Commit 49b3d2b5 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Changed MV install.

parent de27e282
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
set -e
source /root/envsetup/global-conf.sh
apt-get install -y dialog
apt-get install -y dialog build-essential
cd /root
git clone https://git.ubicast.net/mediaserver/burp-custom.git &&
mv burp-custom/* /root/
# application des variables
sed -i "s@^BURP_STATUS_IP=.*@BURP_STATUS_IP=${BURP_STATUS_IP}@" /root/burp-custom.sh
sed -i "s@^BURPUI_PASSWORD=.*@BURPUI_PASSWORD=${BURPUI_PASSWORD}@" /root/burp-custom.sh
sed -i "s@^BURP_SERVER=.*@BURP_SERVER=${BURP_SERVER}@" /root/burp-custom.sh
sed -i "s/^BURP_MAIL_DEST=.*/BURP_MAIL_DEST=${BURP_MAIL_DEST}/" /root/burp-custom.sh
sed -i "s@^BURP_CLIENT_NAME=.*@BURP_CLIENT_NAME=${BURP_CLIENT_NAME}@" /root/burp-custom.sh
sed -i 's@^echo "password = ${BURP_CLIENT_PASSWORD}".*@@' /root/burp-custom.sh
sed -i 's@^echo "restore_client = ${BURP_CLIENT_NAME}".*@@' /root/burp-custom.sh
rm -rf burp-custom
git clone https://git.ubicast.net/mediaserver/burp-custom.git burp-custom
# set conf
sed -i "s@^BURP_STATUS_IP=.*@BURP_STATUS_IP=${BURP_STATUS_IP}@" /root/burp-custom/burp-custom.sh
sed -i "s@^BURPUI_PASSWORD=.*@BURPUI_PASSWORD=${BURPUI_PASSWORD}@" /root/burp-custom/burp-custom.sh
sed -i "s@^BURP_SERVER=.*@BURP_SERVER=${BURP_SERVER}@" /root/burp-custom/burp-custom.sh
sed -i "s/^BURP_MAIL_DEST=.*/BURP_MAIL_DEST=${BURP_MAIL_DEST}/" /root/burp-custom/burp-custom.sh
sed -i "s@^BURP_CLIENT_NAME=.*@BURP_CLIENT_NAME=${BURP_CLIENT_NAME}@" /root/burp-custom/burp-custom.sh
sed -i 's@^echo "password = ${BURP_CLIENT_PASSWORD}".*@@' /root/burp-custom/burp-custom.sh
sed -i 's@^echo "restore_client = ${BURP_CLIENT_NAME}".*@@' /root/burp-custom/burp-custom.sh
# run burp-custom.sh install_fullserver
cd /root
bash /root/burp-custom.sh install_fullserver
bash /root/burp-custom/burp-custom.sh install_fullserver
# get admin_shell
mv /root/admin_shell.sh /home/admin/admin_shell.sh
mv /root/burp-custom/admin_shell.sh /home/admin/admin_shell.sh
# get MS_restore.sh
cp /root/MS_restore.sh /home/admin/MS_restore.sh
cp /root/burp-custom/MS_restore.sh /home/admin/MS_restore.sh
# MS_restore ajout clef ssh ??
sed -i "s@scp /root@scp -i /home/admin/.ssh/id_rsa /root@" /home/admin/MS_restore.sh
......@@ -33,16 +35,15 @@ sed -i "s@ssh ${CLIENT}@ssh -i /home/admin/.ssh/id_rsa root\@${CLIENT}@" /home/a
echo "bash /home/admin/admin_shell.sh" > /home/admin/.bash_profile
# generate admin ssh key
if ( ! test -f /home/admin/.ssh/id_rsa )
then
mkdir -p /home/admin/.ssh
chown -R admin:admin /home/admin/.ssh
sudo -H -u admin bash -c 'ssh-keygen -t rsa -N "" -f /home/admin/.ssh/id_rsa'
if ( ! test -f /home/admin/.ssh/id_rsa ); then
mkdir -p /home/admin/.ssh
chown -R admin:admin /home/admin/.ssh
su admin -c 'ssh-keygen -t rsa -N "" -f /home/admin/.ssh/id_rsa'
fi
# permit admin to transmit burp-custom
cp /root/burp-custom.sh /home/admin/
cp /root/burp*.bz2 /home/admin/
cp /root/burp-custom/burp-custom.sh /home/admin/
cp /root/burp-custom/burp*.bz2 /home/admin/
# restore permissions
chown -R admin:admin /home/admin/
......@@ -51,4 +52,4 @@ echo "admin: ${BURP_MAIL_DEST}" >> /etc/aliases
newaliases
# give root rights to admin
sed -i "s@admin:x:.*@admin:x:0:0::/home/admin:/bin/bash@" /etc/passwd
#sed -i "s@admin:x:.*@admin:x:0:0::/home/admin:/bin/bash@" /etc/passwd
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment