You've already forked net-research
chore: reformatted change_profile script
This commit is contained in:
+40
-19
@@ -5,10 +5,10 @@ USER="ubuntu"
|
|||||||
PASSWORD="ubuntu"
|
PASSWORD="ubuntu"
|
||||||
|
|
||||||
for cmd in sshpass; do
|
for cmd in sshpass; do
|
||||||
if ! command -v $cmd &> /dev/null; then
|
if ! command -v $cmd &>/dev/null; then
|
||||||
echo "Error: $cmd is not installed. Please install it first."
|
echo "Error: $cmd is not installed. Please install it first."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Fetching interfaces from server..."
|
echo "Fetching interfaces from server..."
|
||||||
@@ -39,21 +39,42 @@ profiles=(
|
|||||||
|
|
||||||
select profile in "${profiles[@]}"; do
|
select profile in "${profiles[@]}"; do
|
||||||
case $REPLY in
|
case $REPLY in
|
||||||
1) delay=0; loss=0 ;;
|
1)
|
||||||
2) delay=10; loss=0 ;;
|
delay=0
|
||||||
3) delay=100; loss=0 ;;
|
loss=0
|
||||||
4) delay=10; loss=2 ;;
|
;;
|
||||||
5) delay=50; loss=2 ;;
|
2)
|
||||||
6) delay=100; loss=2 ;;
|
delay=10
|
||||||
7) delay=10; loss=6 ;;
|
loss=0
|
||||||
8)
|
;;
|
||||||
read -p "Enter delay (ms): " delay
|
3)
|
||||||
read -p "Enter packet loss (%): " loss
|
delay=100
|
||||||
;;
|
loss=0
|
||||||
*)
|
;;
|
||||||
echo "Invalid option"
|
4)
|
||||||
continue
|
delay=10
|
||||||
;;
|
loss=2
|
||||||
|
;;
|
||||||
|
5)
|
||||||
|
delay=50
|
||||||
|
loss=2
|
||||||
|
;;
|
||||||
|
6)
|
||||||
|
delay=100
|
||||||
|
loss=2
|
||||||
|
;;
|
||||||
|
7)
|
||||||
|
delay=10
|
||||||
|
loss=6
|
||||||
|
;;
|
||||||
|
8)
|
||||||
|
read -p "Enter delay (ms): " delay
|
||||||
|
read -p "Enter packet loss (%): " loss
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid option"
|
||||||
|
continue
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
break
|
break
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user