Skip to content

Instantly share code, notes, and snippets.

@YoniFeng
YoniFeng / gist:feb774af0d74f5ba04fe9938dc980be2
Last active October 8, 2018 17:32
Bash script to enable/disable remote access to MongoDB server
# Change 255.255.255.255 to external/public ip address
#!/bin/sh
cp /etc/mongod.conf /etc/mongodBackup.conf
grep -q 'bindIp: 127.0.0.1$' /etc/mongod.conf
if [ $? -eq 0 ];
then
echo "Mongo will now allow remote connections"