Last active
September 13, 2022 06:30
-
-
Save imperzer0/f381ab93da4dfa939a54ee6194ad162d to your computer and use it in GitHub Desktop.
filestorage typical environment configuration
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
#!/bin/bash | |
dd if=/dev/random of=filestorage_container bs=1M count=<megabytes> | |
mkfs.ext4 filestorage_container | |
sudo mount --mkdir filestorage_container storage/ | |
ls -alshp storage/ | |
sudo umount $(realpath filestorage_container) |
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
#!/bin/bash | |
echo " BASH > Opening ports..." | |
sudo iptables -I INPUT -p tcp -m tcp --dport 14886 -j ACCEPT | |
sudo iptables -I OUTPUT -p tcp -m tcp --dport 14886 -j ACCEPT | |
echo " BASH > Opened." | |
echo " BASH > Mounting volume..." | |
sudo mount filestorage_container storage | |
echo " BASH > Mounted." | |
echo " BASH > Running server..." | |
cd storage/ | |
echo " BASH > PWD = \"$(pwd)\"" | |
filestorage --address ":14886" --loglevel 3 --password <password> | |
echo " BASH > Execution finished." | |
cd ../ | |
echo " BASH > PWD = \"$(pwd)\"" | |
echo " BASH > Unmounting volume..." | |
sudo umount "$(realpath filestorage_container)" | |
echo " BASH > Unmounted." | |
echo " BASH > Closing ports..." | |
sudo iptables -D INPUT -p tcp -m tcp --dport 14886 -j ACCEPT | |
sudo iptables -D OUTPUT -p tcp -m tcp --dport 14886 -j ACCEPT | |
echo " BASH > Closed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment