forked from berhsi/rechnung
Einige printfs und echos umgebaut
This commit is contained in:
parent
c065d125da
commit
710a452577
23
rechnung.sh
23
rechnung.sh
|
@ -70,7 +70,7 @@ NORMAL="\\033[0;39m"
|
|||
|
||||
check_readable() {
|
||||
|
||||
printf "\n[+] Datei \"$1\" ist lesbar ..."
|
||||
printf "\n[+] Datei %s ist lesbar ..." "$1"
|
||||
if [ -f "$1" ] && [ -r "$1" ]
|
||||
then
|
||||
print_ok
|
||||
|
@ -86,10 +86,10 @@ check_binaries() {
|
|||
binaries=$*
|
||||
|
||||
for program in $binaries; do
|
||||
printf "\n[+] Suche nach Programm $program ..."
|
||||
printf "\n[+] Suche nach Programm %s ..." "$program"
|
||||
if [ ! -x "$program" ]; then
|
||||
print_failed
|
||||
printf "\n[-] Das Programm \"$program\" wird benötigt, aber nicht gefunden."
|
||||
printf "\n[-] Das Programm \"%s\" wird benötigt, aber nicht gefunden." "$program"
|
||||
quit 3
|
||||
else
|
||||
print_ok
|
||||
|
@ -114,7 +114,7 @@ is_option() (
|
|||
print_failed() {
|
||||
|
||||
if [ "$COLORED_OUTPUT" -eq 1 ]; then
|
||||
printf "$RED Failed$NORMAL"
|
||||
printf "%s Failed%s" "$RED" "$NORMAL"
|
||||
else
|
||||
printf " Failed"
|
||||
fi
|
||||
|
@ -123,7 +123,7 @@ print_failed() {
|
|||
print_ok() {
|
||||
|
||||
if [ "$COLORED_OUTPUT" -eq 1 ]; then
|
||||
printf "$GREEN OK$NORMAL"
|
||||
printf "%s OK%s" "$GREEN" "$NORMAL"
|
||||
else
|
||||
printf " OK"
|
||||
fi
|
||||
|
@ -134,9 +134,9 @@ print_warn() {
|
|||
msg=$*
|
||||
|
||||
if [ "$COLORED_OUTPUT" -eq 1 ]; then
|
||||
echo -e "$YELLOW[-]$NORMAL $msg"
|
||||
echo "$YELLOW[-]$NORMAL $msg"
|
||||
else
|
||||
echo -e "[-] $msg"
|
||||
echo "[-] $msg"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ trim_value() {
|
|||
|
||||
reset_values() {
|
||||
|
||||
echo -e "\n[+] Initialisiere Felder für Rechnung neu."
|
||||
printf "\n[+] Initialisiere Felder für Rechnung neu."
|
||||
LINE_BUFFER=""
|
||||
KEY_BUFFER=""
|
||||
VALUE_BUFFER=""
|
||||
|
@ -208,7 +208,7 @@ set_value() {
|
|||
make_invoice() {
|
||||
|
||||
dead_days="14"
|
||||
if [ $(date +%u) -gt 5 ]; then
|
||||
if [ "$(date +%u)" -gt 5 ]; then
|
||||
dead_days="16"
|
||||
fi
|
||||
|
||||
|
@ -284,8 +284,9 @@ proced_ini_line() {
|
|||
}
|
||||
|
||||
quit() {
|
||||
printf "\n$BLUE"
|
||||
printf "[-] Exit$NORMAL\n"
|
||||
printf "\n"
|
||||
print "$BLUE"
|
||||
printf "[-] Exit%s\n" "$NORMAL"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue