sudo netstat -antp | grep :25
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1127/sshd
:25
ps -wwwP 1127
PID PSR TTY STAT TIME COMMAND
1127 0 ? Ss 0:00 /usr/sbin/sshd -D
#!/bin/bash
DATAFILE=$1
FRAGMENT=${2:-us}
REJECT=${3}
TMPFILE='/tmp/b.json'
if [ -z "$REJECT" ] ; then
QUERY=".[]|keys[]| select( . | test(\"^${FRAGMENT}\"))"
else
QUERY=".[]|keys[]| select( . | test(\"^${FRAGMENT}\")|not)"
fi
KEYS=$(cat $DATAFILE | jq -cr --slurp "$QUERY")
rm -f $TMPFILE
for KEY in $KEYS
do
COMMAND="{\"$KEY\":.$KEY}"
cat $DATAFILE | jq -cr $COMMAND >> $TMPFILE
done
cat $TMPFILE | jq --slurp 'add'
{
"description": "",
"hostname": "ubuntu18",
"ip": "",
"password_1": "test123",
"password_2": "test1231",
"username_1": "test",
"username_1_owner": "dude1",
"username_2": "test1",
"username_2_owner": "dude2"
}
./jq_json_build_filtered.sh sample.json us 1
{
"description": "",
"hostname": "ubuntu18",
"ip": "",
"password_1": "test123",
"password_2": "test1231"
}
./jq_json_build_filtered.sh sample.json us
{
"username_1": "test",
"username_1_owner": "dude1",
"username_2": "test1",
"username_2_owner": "dude2"
}
./jq_json_build_filtered.sh "" "us" 1
{
"description": "",
"hostname": "ubuntu18",
"ip": "",
"password_1": "test123",
"password_2": "test1231"
}
./jq_json_build_filtered.sh "" "us"
{
"username_1": "test",
"username_1_owner": "dude1",
"username_2": "test1",
"username_2_owner": "dude2"
}
{
"description": "",
"hostname": "ubuntu18",
"ip": "",
"password_1": "test123",
"password_2": "test1231",
"username_1": "test",
"username_1_owner": "dude1",
"username_2": "test1",
"username_2_owner": "dude2"
}
{
"username_1": "test",
"username_1_owner": "dude1",
"username_2": "test1",
"username_2_owner": "dude2"
}
jq
{
"description": "",
"hostname": "ubuntu18",
"ip": "",
"password_1": "test123",
"password_2": "test1231",
"username_1": "test",
"username_1_owner": "dude1",
"username_2": "test1",
"username_2_owner": "dude2"
}
{
"username_1": "test",
"username_1_owner": "dude1",
"username_2": "test1",
"username_2_owner": "dude2"
}
jq
workbook.write(out);
если волюме не объявлен то докер ничего не стирал
кроме того любые комадны из dokerfile можно выполнить там внутри и увидите что и как
(так как у вас команды простые то прямо попробуйте и скажите что увидели