Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 21. október 2026

Rozdiely pre scripts/shell/sms/sity.sk/sms.sh medzi verziami 1.14 a 1.15

verzia 1.14, 2002/06/21 16:23:34 verzia 1.15, 2002/06/22 15:31:26
Riadok 18  CONFIG_FILE="$HOME/.sms.sh.conf";
Riadok 18  CONFIG_FILE="$HOME/.sms.sh.conf";
 ALIAS_FILE="$HOME/.sms.sh.alias";  ALIAS_FILE="$HOME/.sms.sh.alias";
   
 WWW="http://www.sity.sk/pls/sity"  WWW="http://www.sity.sk/pls/sity"
 TMP_FILE1=`tempfile -p sms.sh || mktemp /tmp/sms.shXXXXXX || echo /tmp/sms.sh$$`  TMP_FILE1=`tempfile -p sms. -s .html || mktemp /tmp/sms.XXXX.html || echo /tmp/sms.$$.html`
 TMP_FILE2=`tempfile -p sms.sh || mktemp /tmp/sms.shXXXXXX || echo /tmp/sms.sh$$`  TMP_FILE2=`tempfile -p sms. -s .html || mktemp /tmp/sms.XXXX.html || echo /tmp/sms.$$.html`
   
 if [ $# -lt 1 ]; then  if [ $# -lt 1 ]; then
         echo -e "Usage:\n       $0 <number-or-alias>\n";          echo -e "Usage:\n       $0 <number-or-alias>\n";
Riadok 36  if [ -z "$number" ]; then
Riadok 36  if [ -z "$number" ]; then
         if [ -f "$ALIAS_FILE" ]; then          if [ -f "$ALIAS_FILE" ]; then
                 echo "found.";                  echo "found.";
                 echo -n "Looking for alias '$1': ";                  echo -n "Looking for alias '$1': ";
                 number=`grep -v '^#' "$ALIAS_FILE" \  #               number=`grep -v '^#' "$ALIAS_FILE" \
                         | grep -i -E '^'"$1"'[   ]*=?[   ]*' \  #                       | grep -i -E '^'"$1"'[   ]*=?[   ]*' \
                         | sed 's/^'"$1"'[        ]*=\?[         ]*\([0-9]\+\)[   ]*$/\1/i' \  #                       | sed 's/^'"$1"'[        ]*=\?[         ]*\([0-9]\+\)[   ]*$/\1/i' \
                         | head -n 1`;  #                       | head -n 1`;
                   number=`awk "/^#/ { next; } \
                           // { gsub(/=/, \"\"); } \
                           /^$1/ { print \\$2; exit;}" "$ALIAS_FILE"`;
                 if [ "$number" ]; then                  if [ "$number" ]; then
                         echo "found number $number.";                          echo "found number $number.";
                 else                  else
Riadok 95  if [ -z "$PASS" ]; then
Riadok 98  if [ -z "$PASS" ]; then
         echo "<censored>"; # to write newline on output          echo "<censored>"; # to write newline on output
 fi  fi
   
 echo 'Enter your message (only one line, max 420 chars, it is binary safe):';  #echo 'Enter your message (only one line, max 420 chars, it is binary safe):';
 IF= read text;  #IF= read text;
 text=`echo "$text" | sed 's/%/%25/g; s/\+/%2B/g; s/ /+/g; s/&/%26/g'`;  #text=`echo "$text" | sed 's/%/%25/g; s/\+/%2B/g; s/ /+/g; s/&/%26/g'`;
   echo 'Enter your message (max 420 chars, lines will be joined with space):';
   text=`cat` # text from stdin, multiple lines
   text="`echo \"$text\" \
           | awk 'BEGIN { ORS="+"} \
           { gsub(/%/, "%25"); \
                   gsub(/\+/, "%2B"); \
                   gsub(/ /, "+"); \
                   gsub(/\&/, "%26"); \
                   print; }'`"
   
   
 # download the file via special wget which stores session cookie to a file  # download the file via special wget which stores session cookie to a file
 # Cookies format:  # Cookies format:
Riadok 113  echo -n 'Checking number of free SMSs...
Riadok 126  echo -n 'Checking number of free SMSs...
 #       $WWW/u_profil.show_stat > $TMP_FILE1;  #       $WWW/u_profil.show_stat > $TMP_FILE1;
 #smss_sent=`grep '^<TD>[0-9]\+</TD>$' $TMP_FILE1 | head -n 1 | sed 's/<TD>\([0-9]\+\).*/\1/'`;  #smss_sent=`grep '^<TD>[0-9]\+</TD>$' $TMP_FILE1 | head -n 1 | sed 's/<TD>\([0-9]\+\).*/\1/'`;
 smss_sent=`GET -H "Cookie: SITY=$COOKIE" \  smss_sent=`GET -H "Cookie: SITY=$COOKIE" \
         $WWW/u_profil.show_stat | awk '/^<TD>[0-9]\+</TD>$/ { gsub(/[><]/, " "); print $2;  exit; } '`;          $WWW/u_profil.show_stat \
           | awk '/^<TD>[0-9]+<\/TD>$/ { gsub(/[><]/, " "); print $2;  exit; } '`;
   
 echo "100-$smss_sent" | bc;  echo "100-$smss_sent" | bc;
   
Riadok 140  if [ $smss_left ]; then
Riadok 154  if [ $smss_left ]; then
         rm -f $TMP_FILE1;          rm -f $TMP_FILE1;
         rm -f $TMP_FILE2;          rm -f $TMP_FILE2;
 else  else
         echo 'Something went wrong, see debug files ($TMP_FILE1, $TMP_FILE2).';          echo "Something went wrong, see debug files ($TMP_FILE1, $TMP_FILE2).";
 fi  fi
   

Legend:
Odstranené z verzie1.14  
zmenené riadky
  Pridané vo verzii1.15

Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok