| Autor | Nachricht | 
  
    |  | 
        
					| Titel: Script mit kdialog hat einen fehler...  Verfasst am: 26.12.2008, 17:49 Uhr |  | 
  
    | 
        
          | 
 
 Anmeldung: 04. Jan 2007
 Beiträge: 1604
 Wohnort: Hamburg
 
 |  | 
        
          | hallo, habe von kdelook.org folgendes Script heruntergeladen: 
 Steghide
 http://www.kde-look.org/content/show.ph ... tent=45323
 
 Also das einbinden von Dateien in eine jpg-datei klappt. Was leider nicht geht, ist das Entpacken via Menü. Wenn ich in die Konsole aber gehe und das Verzeichnis wähle und dort
 
 steghide extract -sf "123.jpg"
 
 Ich glabue, im Script ist folgender Text falsch, welcher genau das tun sollte wie
 
 steghide extract -sf "123.jpg"
 
 
 
 Zitat: 
else #for extracting file
 current_path=$(echo ${1%/*}) #where is the file which should contain embedded file
 
 pass=$(kdialog --password "Type password") then
 steghide extract -sf "$1" -p "$pass"
 fi
 fi
 
 Weiß jemand, wo der Fehler liegt?
 
 Gruß Christopher
 |  
          | _________________
 Es ist dem Untertanen untersagt, den Maßstab seiner beschränkten Einsicht an die Handlungen der Obrigkeit anzulegen - Kurfürst Friedrich Wilhelm von Brandenburg
 www.projektidee.org  | www.gesundheitstabelle.de  |   www.neoliberalyse.de
 
 Zuletzt bearbeitet von stalin2000 am 28.12.2008, 16:39 Uhr, insgesamt ein Mal bearbeitet
 |  
         
	        |  |  | 
  
    |  | 
  
    |  | 
  
    |  | 
        
					| Titel:  Verfasst am: 29.12.2008, 16:47 Uhr |  | 
  
    | 
        
          | 
 
 Anmeldung: 04. Sep 2006
 Beiträge: 280
 
 
 |  | 
        
          | moin in dem Script sind verschiedene Dinge anzupassen.
 
 hiermit funktioniert es so halbwegs
 
 musst mal noch ein bischen anpassen
 
 und Dateien mit Leerzeichen mag es auch nicht.
 
 
 Code: 
--- steghide_servicemenu.sh.org 2006-09-06 00:52:06.000000000 +0200
+++ steghide_servicemenu.sh     2008-12-29 17:30:51.000000000 +0100
 @@ -8,7 +8,7 @@
 
 #comparing if passwords match
 pass=$(kdialog --password "Choose password")
 -               pass2=$(kdialog --password "Retype password (for sure)")
 +               pass2=$(kdialog --password "Retype password for sure ")
 if [ $pass = $pass2 ]; then
 kdialog --yesno "Replace original file?"
 if [ $? = 0 ]; then
 @@ -28,16 +28,16 @@
 fi
 
 else #for extracting file
 -       current_path=$(echo ${1%/*}) #where is the file which should contain embedded file
 -
 +       #current_path=$(echo ${1%/*}) #where is the file which should contain embedded file
 +       current_path=$(pwd)
 pass=$(kdialog --password "Type password")
 
 #testing if the file realy contain another file and if so, getting its name
 -       name=$(steghide info $1 -p "$pass" | grep "embedded file" | awk '{print $3}')
 +       name=$(steghide info $1 -p "$pass" | grep "Eingebettete Datei" | awk '{print $3}' )
 name=$(echo ${name%'":'})
 name=$(echo ${name#'"'})
 -
 -       if [ ${#name} == 0 ]; then
 +       echo "name ist $name"
 +       if [ ${name} == '' ]; then
 kdialog --sorry "This file doesn't contain any embedded file or the password is wrong."
 else
 if [[ -f "$current_path/$name" ]]; then #if the name of the embedded file is allready used in this directory, user have to choose another name for saving this file
 
 gruss retabell
 |  
          |  |  
         
	        |  |  | 
  
    |  | 
  
    |  | 
  
    |  | 
        
					| Titel:  Verfasst am: 29.12.2008, 18:55 Uhr |  | 
  
    | 
        
          | 
 
 Anmeldung: 04. Jan 2007
 Beiträge: 1604
 Wohnort: Hamburg
 
 |  | 
        
          | Hey.... Danke! 
 Was genau muß ich denn da anpassen? und was haben diese Dinger zu bedeuten und was bedeuten die ganzen plus und minus Zeichen?
 
 Zitat: 
--- steghide_servicemenu.sh.org 2006-09-06 00:52:06.000000000 +0200
 +++ steghide_servicemenu.sh     2008-12-29 17:30:51.000000000 +0100
 @@ -8,7 +8,7 @@
 
 ich hatte jetzt einfach mal das hier eingefügt und es ging noch nicht (die Paßworteingabe kam bevor man die zu versteckende Datei auswählen konnte... außerdem funktionierte der obere Teil des Scripts, der zum Einbetten in die Jpg Datei ja schon. Das Problem bestand ja ausschließlich beim wieder Auspacken der Datei...):
 
 
 Zitat: 
#comparing if passwords match
 pass=$(kdialog --password "Choose password")
 -               pass2=$(kdialog --password "Retype password (for sure)")
 +               pass2=$(kdialog --password "Retype password for sure ")
 if [ $pass = $pass2 ]; then
 kdialog --yesno "Replace original file?"
 if [ $? = 0 ]; then
 fi
 
 else #for extracting file
 -       current_path=$(echo ${1%/*}) #where is the file which should contain embedded file
 -
 +       #current_path=$(echo ${1%/*}) #where is the file which should contain embedded file
 +       current_path=$(pwd)
 pass=$(kdialog --password "Type password")
 
 #testing if the file realy contain another file and if so, getting its name
 -       name=$(steghide info $1 -p "$pass" | grep "embedded file" | awk '{print $3}')
 +       name=$(steghide info $1 -p "$pass" | grep "Eingebettete Datei" | awk '{print $3}' )
 name=$(echo ${name%'":'})
 name=$(echo ${name#'"'})
 -
 -       if [ ${#name} == 0 ]; then
 +       echo "name ist $name"
 +       if [ ${name} == '' ]; then
 kdialog --sorry "This file doesn't contain any embedded file or the password is wrong."
 else
 if [[ -f "$current_path/$name" ]]; then #if the name of the embedded file is allready used in this directory, user have to choose another name for saving this file
 |  
          | _________________
 Es ist dem Untertanen untersagt, den Maßstab seiner beschränkten Einsicht an die Handlungen der Obrigkeit anzulegen - Kurfürst Friedrich Wilhelm von Brandenburg
 www.projektidee.org  | www.gesundheitstabelle.de  |   www.neoliberalyse.de
 |  
         
	        |  |  | 
  
    |  | 
  
    |  | 
  
    |  | 
        
					| Titel:  Verfasst am: 29.12.2008, 19:41 Uhr |  | 
  
    | 
        
          | 
 
 Anmeldung: 17. Dez 2003
 Beiträge: 16809
 
 
 |  | 
        
          | Das ist doch schwachsinn was ihr da ändert, seit wann parst man denn deutsche ausgaben von nem programm? Wenn dann macht man nen lang override wie 
 LANG= LC_ALL= programm
 
 davor.
 |  
          |  |  
         
	        |  |  | 
  
    |  | 
  
    |  | 
  
    |  | 
        
					| Titel:  Verfasst am: 30.12.2008, 14:37 Uhr |  | 
  
    | 
        
          | 
 
 Anmeldung: 04. Jan 2007
 Beiträge: 1604
 Wohnort: Hamburg
 
 |  | 
        
          | Hallo Kano, 
 also ich hab keine Ahnung vom "scripten"... ich versuch das nur so anzupassen, daß es läuft....
 
 weißt Du eventuell, wo in diesem Teil der Fehler liegen könnte ?
 
 
 Zitat: 
else #for extracting file
current_path=$(echo ${1%/*}) #where is the file which should contain embedded file
 
 pass=$(kdialog --password "Type password") then
 steghide extract -sf "$1" -p "$pass"
 fi
 fi
 |  
          | _________________
 Es ist dem Untertanen untersagt, den Maßstab seiner beschränkten Einsicht an die Handlungen der Obrigkeit anzulegen - Kurfürst Friedrich Wilhelm von Brandenburg
 www.projektidee.org  | www.gesundheitstabelle.de  |   www.neoliberalyse.de
 |  
         
	        |  |  | 
  
    |  | 
  
    |  | 
  
    |  | 
        
					| Titel:  Verfasst am: 03.08.2009, 14:05 Uhr |  | 
  
    | 
        
          | 
 
 Anmeldung: 04. Jan 2007
 Beiträge: 1604
 Wohnort: Hamburg
 
 |  | 
        
          | also so funktioniert's zumindest: 
 /home/[user]/bin/steghide_servicemenu.sh
 
 
 
 
 Zitat: 
#/bin/sh
 if [ $2 = e ]; then #for embedding file
 
 file_to_hide=$(kdialog --getopenfilename .) #choose which file to embed
 
 if [ $? = 0 ]; then #if user does't press cancel
 
 #comparing if passwords match
 pass=$(kdialog --password "Choose password")
 pass2=$(kdialog --password "Retype password for sure ")
 if [ $pass = $pass2 ]; then
 kdialog --yesno "Replace original file?"
 if [ $? = 0 ]; then
 steghide embed -cf "$1" -ef "$file_to_hide" -p "$pass"
 else
 file_to_save=$(kdialog --getsavefilename .)
 if [ $? = 0 ]; then
 wrong=$(steghide embed -cf "$1" -ef "$file_to_hide" -p "$pass" -sf "$file_to_save")
 if [ $wrong = 1 ]; then
 kdialog --error "Steghide ended with error"
 fi
 fi
 fi
 else
 kdialog --sorry "Passwords don't match. Ending script."
 fi
 fi
 
 else #for extracting file
 #current_path=$(echo ${1%/*}) #where is the file which should contain embedded file
 current_path=$(pwd)
 pass=$(kdialog --password "Type password")
 
 #testing if the file realy contain another file and if so, getting its name
 name=$(steghide info $1 -p "$pass" | grep "Eingebettete Datei" | awk '{print $3}' )
 name=$(echo ${name%'":'})
 name=$(echo ${name#'"'})
 echo "name ist $name"
 if [ ${name} == '' ]; then
 kdialog --sorry "This file doesn't contain any embedded file or the password is wrong."
 else
 if [[ -f "$current_path/$name" ]]; then #if the name of the embedded file is allready used in this directory, user have to choose another name for saving this file
 kdialog --sorry "The embedded file would be saved as $current_path/$name but this file allready exists. Choose another place."
 file_to_save=$(kdialog --getsavefilename .)
 if [ $? = 0 ]; then
 wrong=$(steghide extract -sf "$1" -xf "$file_to_save" -p "$pass")
 if [ $wrong = 1 ]; then
 kdialog --error "Steghide ended with error"
 fi
 fi
 else #if the name is possible to use, script just inform the user where the file was saved
 wrong=$(steghide extract -sf "$1" -p "$pass")
 if [ $wrong = 1 ]; then
 kdialog --error "Steghide ended with error"
 else
 kdialog --msgbox "The embedded file was saved as $current_path/$name."
 fi
 fi
 fi
 fi
 |  
          | _________________
 Es ist dem Untertanen untersagt, den Maßstab seiner beschränkten Einsicht an die Handlungen der Obrigkeit anzulegen - Kurfürst Friedrich Wilhelm von Brandenburg
 www.projektidee.org  | www.gesundheitstabelle.de  |   www.neoliberalyse.de
 |  
         
	        |  |  | 
  
    |  | 
  
    |  | 
  
  
    |  |