mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Use tmp dir
This commit is contained in:
		
							parent
							
								
									93d4c0aeed
								
							
						
					
					
						commit
						a752460eab
					
				
					 1 changed files with 16 additions and 16 deletions
				
			
		|  | @ -1,27 +1,27 @@ | ||||||
| #!/bin/bash | #!/bin/bash | ||||||
| 
 | TMP_DIR="/tmp" | ||||||
| yad --form --field="Pretty name" "" --field="Name" "" --field="Releases" "" --field="Editions" "" --field="URL" "" --field="ISO" "" --field="Hash" "" > template.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 template.tmp | cut -d'|' -f1)" | PRETTY_NAME="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f1)" | ||||||
| NAME="$(cat template.tmp | cut -d'|' -f2)" | NAME="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f2)" | ||||||
| RELEASES="$(cat template.tmp | cut -d'|' -f3)" | RELEASES="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f3)" | ||||||
| EDITIONS="$(cat template.tmp | cut -d'|' -f4)" | EDITIONS="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f4)" | ||||||
| URL="$(cat template.tmp | cut -d'|' -f5)" | URL="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f5)" | ||||||
| ISO="$(cat template.tmp | cut -d'|' -f6)" | ISO="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f6)" | ||||||
| HASH="$(cat template.tmp | cut -d'|' -f7)" | HASH="$(cat ${TMP_DIR}/template.tmp | cut -d'|' -f7)" | ||||||
| echo "    $NAME)           PRETTY_NAME=$PRETTY_NAME;; | echo "    $NAME)           PRETTY_NAME=$PRETTY_NAME;; | ||||||
| " > newvm.tmp | " >  ${TMP_DIR}/newvm.tmp | ||||||
| echo "    $NAME \\ | echo "    $NAME \\ | ||||||
| " >> newvm.tmp | " >>  ${TMP_DIR}/newvm.tmp | ||||||
| echo "function releases_$NAME() { | echo "function releases_$NAME() { | ||||||
|     echo $RELEASES |     echo $RELEASES | ||||||
| } | } | ||||||
| " >> newvm.tmp | " >>  ${TMP_DIR}/newvm.tmp | ||||||
| echo "function editions_$NAME() { | echo "function editions_$NAME() { | ||||||
|     echo $EDITIONS |     echo $EDITIONS | ||||||
| } | } | ||||||
| " >> newvm.tmp | " >>  ${TMP_DIR}/newvm.tmp | ||||||
| echo "function get_$NAME() { | echo "function get_$NAME() { | ||||||
|     local EDITION="${1:-}" |     local EDITION="${1:-}" | ||||||
|     local HASH="" |     local HASH="" | ||||||
|  | @ -30,10 +30,10 @@ echo "function get_$NAME() { | ||||||
|     HASH=\"$(wget -q -O- "${URL}/CHECKSUM" | grep "(${ISO}" | cut -d' ' -f4)\" |     HASH=\"$(wget -q -O- "${URL}/CHECKSUM" | grep "(${ISO}" | cut -d' ' -f4)\" | ||||||
|     echo "${URL}/${ISO} ${HASH}" |     echo "${URL}/${ISO} ${HASH}" | ||||||
| } | } | ||||||
| " >> newvm.tmp | " >>  ${TMP_DIR}/newvm.tmp | ||||||
| echo "template.tmp content: | echo "template.tmp content: | ||||||
| " | " | ||||||
| cat template.tmp | cat  ${TMP_DIR}/template.tmp | ||||||
| echo "newvm.tmp content: | echo "newvm.tmp content: | ||||||
| " | " | ||||||
| cat newvm.tmp | cat  ${TMP_DIR}/newvm.tmp | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue