Skip to content

Instantly share code, notes, and snippets.

@bunlongheng
Last active March 1, 2019 20:49
Show Gist options
  • Save bunlongheng/b22e1ebe757939aa44a7ab6ba942b3fa to your computer and use it in GitHub Desktop.
Save bunlongheng/b22e1ebe757939aa44a7ab6ba942b3fa to your computer and use it in GitHub Desktop.
path="/home/benu/backup"
if [ -d $path ]
then
echo "Directory $path exists."
echo "Remove old path"
rm -rf $path
echo "Create new path"
mkdir $path
else
echo "Directory $path does not exists."
echo "Create new path"
mkdir $path
fi
ifconfig >> /home/benu/backup/ifconfig.txt
cat /home/benu/SSC.cfg >> /home/benu/backup/SSC.cfg.txt
cat /etc/sysconfig/network-scripts/ifcfg-eth0 >> /home/benu/backup/eth0.txt
cat /etc/sysconfig/network-scripts/ifcfg-eth1 >> /home/benu/backup/eth1.txt
cat /etc/sysconfig/network-scripts/ifcfg-eth2 >> /home/benu/backup/eth2.txt
cat /usr/share/nginx/ssc-portal/.env >> /home/benu/backup/env.txt
cat /etc/hosts >> /home/benu/backup/hosts.txt
cat /etc/php.ini >> /home/benu/backup/php.ini.txt
cat /etc/nginx/nginx.conf >> /home/benu/backup/nginx.conf.txt
cat /home/benu/.ssh/authorized_keys >> /home/benu/backup/authorized_keys.txt
cat /etc/resolv.conf >> /home/benu/backup/resolv.conf.txt
cd /home/benu/backup/
python -m SimpleHTTPServer 8888
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment