mirror of
https://github.com/oSoWoSo/DistroHopper.git
synced 2024-08-14 22:46:53 +00:00
add_distroTMP > add_distro
This commit is contained in:
parent
d8f7257726
commit
f75bf0d70a
2 changed files with 12 additions and 65 deletions
|
@ -1,7 +1,6 @@
|
|||
#!/bin/bash
|
||||
TMP_DIR="/tmp"
|
||||
yad --form --field="Pretty name" "" --field="Name" "" --field="Releases" "" --field="Editions" "" --field="URL" "" --field="ISO" "" --field="Hash" "" > ${TMP_DIR}/template.tmp
|
||||
|
||||
yad --form --field="Pretty name" "" --field="Name" "" --field="Releases" "" --field="Editions" "" --field="URL" "" --field="ISO" "" --field="Checksum file" "" > ${TMP_DIR}/template.tmp
|
||||
|
||||
PRETTY_NAME="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f1)"
|
||||
NAME="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f2)"
|
||||
|
@ -9,31 +8,24 @@ RELEASES="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f3)"
|
|||
EDITIONS="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f4)"
|
||||
URL="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f5)"
|
||||
ISO="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f6)"
|
||||
HASH="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f7)"
|
||||
CHECKSUM_FILE="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f7)"
|
||||
echo " $NAME) PRETTY_NAME=$PRETTY_NAME;;
|
||||
" > ${TMP_DIR}/newvm.tmp
|
||||
echo " $NAME \\
|
||||
" >> ${TMP_DIR}/newvm.tmp
|
||||
echo "function releases_$NAME() {
|
||||
" > ${TMP_DIR}/${NAME}.tmp
|
||||
{ echo " $NAME \\
|
||||
"; echo "function releases_$NAME() {
|
||||
echo $RELEASES
|
||||
}
|
||||
" >> ${TMP_DIR}/newvm.tmp
|
||||
echo "function editions_$NAME() {
|
||||
"; echo "function editions_$NAME() {
|
||||
echo $EDITIONS
|
||||
}
|
||||
" >> ${TMP_DIR}/newvm.tmp
|
||||
echo "function get_$NAME() {
|
||||
"; echo "function get_$NAME() {
|
||||
local EDITION="${1:-}"
|
||||
local HASH=""
|
||||
local ISO="$ISO"
|
||||
local URL="$URL"
|
||||
HASH="$HASH"
|
||||
echo "${URL}/${ISO} ${HASH}"
|
||||
HASH=\"$(wget -q -O- "${URL}/${CHECKSUM_FILE}" | grep "(${ISO}" | cut -d' ' -f4)\"
|
||||
echo \"${URL}/${ISO} ${HASH}\"
|
||||
}
|
||||
" >> ${TMP_DIR}/newvm.tmp
|
||||
echo "template.tmp content:
|
||||
"
|
||||
cat ${TMP_DIR}/template.tmp
|
||||
echo "newvm.tmp content:
|
||||
"
|
||||
cat ${TMP_DIR}/newvm.tmp
|
||||
"; } >> ${TMP_DIR}/${NAME}.tmp
|
||||
|
||||
meld ${TMP_DIR}/${NAME}.tmp ../quickget
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
#!/bin/bash
|
||||
TMP_DIR="/tmp"
|
||||
yad --form --field="Pretty name" "" --field="Name" "" --field="Releases" "" --field="Editions" "" --field="URL" "" --field="ISO" "" --field="Hash" "" > ${TMP_DIR}/template.tmp
|
||||
|
||||
|
||||
PRETTY_NAME="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f1)"
|
||||
NAME="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f2)"
|
||||
RELEASES="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f3)"
|
||||
EDITIONS="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f4)"
|
||||
URL="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f5)"
|
||||
ISO="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f6)"
|
||||
HASH="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f7)"
|
||||
echo " $NAME) PRETTY_NAME=$PRETTY_NAME;;
|
||||
" > ${TMP_DIR}/newvm.tmp
|
||||
{ echo " $NAME \\
|
||||
"; echo "function releases_$NAME() {
|
||||
echo $RELEASES
|
||||
}
|
||||
"; echo "function editions_$NAME() {
|
||||
echo $EDITIONS
|
||||
}
|
||||
"; echo "function get_$NAME() {
|
||||
local EDITION="${1:-}"
|
||||
local HASH=""
|
||||
local ISO="$ISO"
|
||||
local URL="$URL"
|
||||
HASH=\"$(wget -q -O- "${URL}/CHECKSUM" | grep "(${ISO}" | cut -d' ' -f4)\"
|
||||
echo "${URL}/${ISO} ${HASH}"
|
||||
}
|
||||
"; echo "function get_$NAME() {
|
||||
local EDITION="${1:-}"
|
||||
local HASH=""
|
||||
local ISO="$ISO"
|
||||
local URL="$URL"
|
||||
HASH=\"$(wget -q -O- "${URL}/CHECKSUM" | grep "(${ISO}" | cut -d' ' -f4)\"
|
||||
echo "${URL}/${ISO} ${HASH}"
|
||||
}
|
||||
"; echo "template.tmp content:
|
||||
"; } >> ${TMP_DIR}/newvm.tmp
|
||||
|
||||
|
||||
cat ${TMP_DIR}/template.tmp
|
||||
echo "newvm.tmp content:
|
||||
"
|
||||
cat ${TMP_DIR}/newvm.tmp
|
Loading…
Reference in a new issue