Skip to main content
added 320 characters in body
Source Link
Can
  • 93
  • 14

I can not give much explanation because my English is bad. The example of what I want to do is below;

Putty appearance:

Before;try.sh

root@ubuntu#!/bin/sh
echo -n "Enter the port:~#"
read shports
if try[ ! -d "$ports" ]; then

mkdir -p /root/port$ports
echo "The folder was created for $ports"
wget -q www.shexample.com/example.tar.bz2
Entertar the-xjf Port:example.tar.bz2
su root -c "screen -A -m -d -S 'example$ports' ./example -RunningAsRootIsEvilAndIKnowThat"
echo "$ports started."
else
exit 0
fi

After;Putty;

root@ubuntu:~# sh try.sh
Enter the Portport: 44554445, 4546,8563,2324
4455 portCreated isfolder opened.'port4445'
4546 portCreated isfolder opened.'port4546'
8563 port is4445 openedstarted.
2324 port is4546 openedstarted.

How can i make?

I can not give much explanation because my English is bad. The example of what I want to do is below;

Putty appearance:

Before;

root@ubuntu:~# sh try.sh
Enter the Port:

After;

root@ubuntu:~# sh try.sh
Enter the Port: 4455,4546,8563,2324
4455 port is opened.
4546 port is opened.
8563 port is opened.
2324 port is opened.

How can i make?

I can not give much explanation because my English is bad. The example of what I want to do is below;

try.sh

#!/bin/sh
echo -n "Enter the port:"
read ports
if [ ! -d "$ports" ]; then

mkdir -p /root/port$ports
echo "The folder was created for $ports"
wget -q www.example.com/example.tar.bz2
tar -xjf example.tar.bz2
su root -c "screen -A -m -d -S 'example$ports' ./example -RunningAsRootIsEvilAndIKnowThat"
echo "$ports started."
else
exit 0
fi

Putty;

root@ubuntu:~# sh try.sh
Enter the port: 4445, 4546
Created folder 'port4445'
Created folder 'port4546'
4445 started.
4546 started.

How can i make?

edited title
Link
Can
  • 93
  • 14

shell script - How can i make multiple-read?

Source Link
Can
  • 93
  • 14

How can i make multiple-read?

I can not give much explanation because my English is bad. The example of what I want to do is below;

Putty appearance:

Before;

root@ubuntu:~# sh try.sh
Enter the Port:

After;

root@ubuntu:~# sh try.sh
Enter the Port: 4455,4546,8563,2324
4455 port is opened.
4546 port is opened.
8563 port is opened.
2324 port is opened.

How can i make?