Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Folgendes Problem: Also mein Systemanalysetool is soweit fertig gescriptet, aber ein Fehler gibts im Code noch:
- Und zwar wird die Ausgabe vom folgenden Befehl (dem dialog) IMMER gemacht, auch wenn garkein parameter zu dem befehl beim ausführen geschrieben wird, ich tippe also zb nur ./script.txt und trotzdem behandelt ders, als wär das ./script.txt +h oder so.
- Das intressante ist aber, dass er zwar die Meldung gibt und nach dem Passwort fragt, JEDOCH die Datei in Wahrheit garnicht verschiebt!
- if [ -f /etc/cron.weekly/script.txt ]
- then
- cd ~
- elif [ $1="+w" ]
- then
- sudo mv ~/Desktop/script.txt /etc/cron.weekly/script.txt
- dialog --title "Automatischer Toolstart:" --backtitle "Tooleinstellungen" --msgbox "Tool wird nun jede Woche ausgeführt." 0 0
- clear
- elif [ $1="+wd" ]
- then
- sudo mv ~/Desktop/script.txt /etc/cron.daily/script.txt
- dialog --title "Automatischer Toolstart:" --backtitle "Tooleinstellungen" --msgbox "Tool wird nun jede Woche ausgeführt." 0 0
- clear
- elif [ $1="+dw" ]
- then
- sudo mv ~/Desktop/script.txt /etc/cron.daily/script.txt
- dialog --title "Automatischer Toolstart:" --backtitle "Tooleinstellungen" --msgbox "Tool wird nun jede Woche ausgeführt." 0 0
- clear
- elif [ $1="+wh" ]
- then
- sudo mv ~/Desktop/script.txt /etc/cron.hourly/script.txt
- dialog --title "Automatischer Toolstart:" --backtitle "Tooleinstellungen" --msgbox "Tool wird nun jede Woche ausgeführt." 0 0
- clear
- elif [ $1="+hw" ]
- then
- sudo mv ~/Desktop/script.txt /etc/cron.hourly/script.txt
- dialog --title "Automatischer Toolstart:" --backtitle "Tooleinstellungen" --msgbox "Tool wird nun jede Woche ausgeführt." 0 0
- clear
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement