slurm_config/x0.host.sh
2024-12-17 14:40:01 +08:00

31 lines
614 B
Bash
Executable File

#!/bin/bash
echo "================old file:================"
cat /etc/hosts
echo "================hosts.txt================"
cat ~/config/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 ~/config/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