Как скачать дистрибутивы 1С ubuntu/debian в терминале
Скрипт сборки docker контейнера с толстым клиентом 1С
Идея понравилась сделал свой скрипт:
$ nano download_pg.sh
#!/bin/bash
#20180809
USERNAME='вставить'
PASSWORD='вставить'
if [[ -z "$USERNAME" ]];then
echo "USERNAME not set"
exit 1
fi
if [[ -z "$PASSWORD" ]];then
echo "PASSWORD not set"
exit 1
fi
echo "Getting versions, please wait."
SRC=$(curl -c /tmp/cookies.txt -s -L https://releases.1c.ru)
ACTION=$(echo "$SRC" | grep -oP '(?<=form method="post" id="loginForm" action=")[^"]+(?=")')
EXECUTION=$(echo "$SRC" | grep -oP '(?<=input type="hidden" name="execution" value=")[^"]+(?=")')
curl -s -L \
-o /dev/null \
-b /tmp/cookies.txt \
-c /tmp/cookies.txt \
--data-urlencode "inviteCode=" \
--data-urlencode "execution=$EXECUTION" \
--data-urlencode "_eventId=submit" \
--data-urlencode "username=$USERNAME" \
--data-urlencode "password=$PASSWORD" \
https://login.1c.ru"$ACTION"
if ! grep -q "TGC" /tmp/cookies.txt ;then
echo "Auth failed"
exit 1
fi
clear
curl -s -b /tmp/cookies.txt https://releases.1c.ru/project/AddCompPostgre |
grep 'a href="/version_files?nick=AddCompPostgre' |
tr -s '=" ' ' ' |
awk -F ' ' '{print $5}' |
sort -Vr | pr -T -5
read -i "10.5-9.1C" -p "Input version for download: " -e VER
echo $VER
if [[ -z "$VER" ]];then
echo "VERSION not set"
exit 1
fi
#if [[ "8.3." = "$VER" ]];then
# echo "Need full VERSION number"
# exit 1
#fi
VER1=${VER//./_}
VER1=${VER1//-/_}
VER2=${VER//-/_}
POSTGRESQL=$(curl -s -G \
-b /tmp/cookies.txt \
--data-urlencode "nick=AddCompPostgre" \
--data-urlencode "ver=$VER" \
--data-urlencode "path=AddCompPostgre\\$VER1\\postgresql_${VER2}_amd64_deb.tar.bz2" \
https://releases.1c.ru/version_file | grep -oP '(?<=a href=")[^"]+(?=">Скачать дистрибутив)')
#echo $CLIENTLINK
ADDON=$(curl -s -G \
-b /tmp/cookies.txt \
--data-urlencode "nick=AddCompPostgre" \
--data-urlencode "ver=$VER" \
--data-urlencode "path=AddCompPostgre\\$VER1\\postgresql_${VER2}_amd64_addon_deb.tar.bz2" \
https://releases.1c.ru/version_file | grep -oP '(?<=a href=")[^"]+(?=">Скачать дистрибутив)')
#echo $SERVERLINK
mkdir -p dist
curl --fail -b /tmp/cookies.txt -o dist/postgresql_${VER2}_amd64_deb.tar.bz2 -L "$POSTGRESQL"
curl --fail -b /tmp/cookies.txt -o dist/postgresql_${VER2}_amd64_addon_deb.tar.bz2 -L "$ADDON"
rm /tmp/cookies.txt
Сохранить.
$ chmod +x download_pg.sh
$ ./download_pg.sh
Скрипт сборки docker контейнера с толстым клиентом 1С
Идея понравилась сделал свой скрипт:
$ nano download_pg.sh
#!/bin/bash
#20180809
USERNAME='вставить'
PASSWORD='вставить'
if [[ -z "$USERNAME" ]];then
echo "USERNAME not set"
exit 1
fi
if [[ -z "$PASSWORD" ]];then
echo "PASSWORD not set"
exit 1
fi
echo "Getting versions, please wait."
SRC=$(curl -c /tmp/cookies.txt -s -L https://releases.1c.ru)
ACTION=$(echo "$SRC" | grep -oP '(?<=form method="post" id="loginForm" action=")[^"]+(?=")')
EXECUTION=$(echo "$SRC" | grep -oP '(?<=input type="hidden" name="execution" value=")[^"]+(?=")')
curl -s -L \
-o /dev/null \
-b /tmp/cookies.txt \
-c /tmp/cookies.txt \
--data-urlencode "inviteCode=" \
--data-urlencode "execution=$EXECUTION" \
--data-urlencode "_eventId=submit" \
--data-urlencode "username=$USERNAME" \
--data-urlencode "password=$PASSWORD" \
https://login.1c.ru"$ACTION"
if ! grep -q "TGC" /tmp/cookies.txt ;then
echo "Auth failed"
exit 1
fi
clear
curl -s -b /tmp/cookies.txt https://releases.1c.ru/project/AddCompPostgre |
grep 'a href="/version_files?nick=AddCompPostgre' |
tr -s '=" ' ' ' |
awk -F ' ' '{print $5}' |
sort -Vr | pr -T -5
read -i "10.5-9.1C" -p "Input version for download: " -e VER
echo $VER
if [[ -z "$VER" ]];then
echo "VERSION not set"
exit 1
fi
#if [[ "8.3." = "$VER" ]];then
# echo "Need full VERSION number"
# exit 1
#fi
VER1=${VER//./_}
VER1=${VER1//-/_}
VER2=${VER//-/_}
POSTGRESQL=$(curl -s -G \
-b /tmp/cookies.txt \
--data-urlencode "nick=AddCompPostgre" \
--data-urlencode "ver=$VER" \
--data-urlencode "path=AddCompPostgre\\$VER1\\postgresql_${VER2}_amd64_deb.tar.bz2" \
https://releases.1c.ru/version_file | grep -oP '(?<=a href=")[^"]+(?=">Скачать дистрибутив)')
#echo $CLIENTLINK
ADDON=$(curl -s -G \
-b /tmp/cookies.txt \
--data-urlencode "nick=AddCompPostgre" \
--data-urlencode "ver=$VER" \
--data-urlencode "path=AddCompPostgre\\$VER1\\postgresql_${VER2}_amd64_addon_deb.tar.bz2" \
https://releases.1c.ru/version_file | grep -oP '(?<=a href=")[^"]+(?=">Скачать дистрибутив)')
#echo $SERVERLINK
mkdir -p dist
curl --fail -b /tmp/cookies.txt -o dist/postgresql_${VER2}_amd64_deb.tar.bz2 -L "$POSTGRESQL"
curl --fail -b /tmp/cookies.txt -o dist/postgresql_${VER2}_amd64_addon_deb.tar.bz2 -L "$ADDON"
rm /tmp/cookies.txt
Сохранить.
$ chmod +x download_pg.sh
$ ./download_pg.sh
Комментариев нет:
Отправить комментарий