Rating:
by DeaD_EyE, Thursday, April 21st 2011, 8:13am
![]() |
Source code |
1 |
echo "Yes" | ./hldsupdatetool.bin |
![]() |
Source code |
1 2 3 |
./hldsupdatetool.bin <<HIER_IST_DAS_ENDE Yes HIER_IST_DAS_ENDE |
![]() |
Source code |
1 2 3 |
./hldsupdatetool.bin <<EOF Yes EOF |
![]() |
Source code |
1 |
./hldsupdatetool.bin <<<"Yes" |
![]() |
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
#!/bin/bash STEAMTOOLURL="http://storefront.steampowered.com/download/hldsupdatetool.bin" STEAMTOOLFILE="hldsupdatetool.bin" STEAMINSTALLDIR="/home/server/serverfiles" #colors RED="tput setf 4" GREEN="tput setf 2" NORM="tput op" checkWritePath() { touch "$1/temp$$" 2> /dev/null || return 1 rm "$1/temp$$" return 0 } getSteamInstaller() { cd "$2" wget -q -nc "$1" || return 1 return 0 } installSteamTool() { which uncompress > /dev/null || return 1 cd "$2" chmod u+x "$1" echo "Installiere steam" "./$1" >/dev/null <<<"Yes" [ -x ./steam ] || return 2 echo -e "Aktualisiere steam \c" for (( n=2 ; n <= 4; n++ )); do echo -e "..\c" ./steam &> /dev/null && break done if ./steam &> /dev/null; then echo return 0 else echo return 3 fi } checkWritePath "$STEAMINSTALLDIR" || { $RED; echo "Keine Schreibrechte auf "$STEAMINSTALLDIR""; $NORM; exit ;} echo "Lade $STEAMTOOLFILE herunter" getSteamInstaller "$STEAMTOOLURL" "$STEAMINSTALLDIR" || { $RED; echo "Download fehlgeschlagen"; $NORM; exit ;} installSteamTool "$STEAMTOOLFILE" "$STEAMINSTALLDIR" case $? in 0) $GREEN; echo "Update des Steamtools erfolgreich"; $NORM ;; 1) $RED; echo "Uncompress fehlt"; $NORM; exit ;; 2) $RED; echo "Entpacken von steam fehlgeschlagen"; $NORM; exit ;; 3) $RED; echo "Update fehlgeschlagen"; $NORM; exit ;; esac |
This article has been read 193,433 times.
Tags: here-doc, Here-String
Categories: Allgemein
by Tessie (Sunday, August 21st 2011, 3:27am)
There is a critical shortage of informative atrciles like this.
Previous article
by DeaD_EyE (Tuesday, March 22nd 2011, 1:54pm)
Friday, June 17th 2011, 11:43pm
Sunday, June 5th 2011, 8:42pm
Sunday, May 29th 2011, 5:37pm
Thursday, April 21st 2011, 8:13am
Tuesday, March 22nd 2011, 1:54pm
by paini (Jan 27th 2022, 10:48am)
by theJEWandI (Sep 20th 2011, 5:13am)
by zhuowu (Sep 20th 2011, 2:44am)
by pisey2002my (Sep 16th 2011, 4:09am)
by MAMYCAY (Sep 16th 2011, 3:08am)
by HSFighter Feb 8th 2011, 7:32pm