31 lines
596 B
Bash
Executable File
31 lines
596 B
Bash
Executable File
#!/bin/bash
|
|
|
|
echo "================old file:================"
|
|
cat /etc/hosts
|
|
echo "================hosts.txt================"
|
|
cat files/hosts.txt
|
|
echo ""
|
|
read -r -p "Do you want to append the host.txt? [y/N] " input
|
|
|
|
case $input in
|
|
[yY][eE][sS]|[yY])
|
|
echo "You say Yes"
|
|
echo "================do job ...================"
|
|
cat files/hosts.txt | sudo tee -a /etc/hosts
|
|
|
|
echo "================new file:"================
|
|
cat /etc/hosts
|
|
;;
|
|
[nN][oO]|[nN])
|
|
echo "You say No"
|
|
;;
|
|
*)
|
|
echo "skip"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
|
|
|
|
|