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() {
|
check_readable() {
|
||||||
|
|
||||||
printf "\n[+] Datei \"$1\" ist lesbar ..."
|
printf "\n[+] Datei %s ist lesbar ..." "$1"
|
||||||
if [ -f "$1" ] && [ -r "$1" ]
|
if [ -f "$1" ] && [ -r "$1" ]
|
||||||
then
|
then
|
||||||
print_ok
|
print_ok
|
||||||
|
@ -86,10 +86,10 @@ check_binaries() {
|
||||||
binaries=$*
|
binaries=$*
|
||||||
|
|
||||||
for program in $binaries; do
|
for program in $binaries; do
|
||||||
printf "\n[+] Suche nach Programm $program ..."
|
printf "\n[+] Suche nach Programm %s ..." "$program"
|
||||||
if [ ! -x "$program" ]; then
|
if [ ! -x "$program" ]; then
|
||||||
print_failed
|
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
|
quit 3
|
||||||
else
|
else
|
||||||
print_ok
|
print_ok
|
||||||
|
@ -114,7 +114,7 @@ is_option() (
|
||||||
print_failed() {
|
print_failed() {
|
||||||
|
|
||||||
if [ "$COLORED_OUTPUT" -eq 1 ]; then
|
if [ "$COLORED_OUTPUT" -eq 1 ]; then
|
||||||
printf "$RED Failed$NORMAL"
|
printf "%s Failed%s" "$RED" "$NORMAL"
|
||||||
else
|
else
|
||||||
printf " Failed"
|
printf " Failed"
|
||||||
fi
|
fi
|
||||||
|
@ -123,7 +123,7 @@ print_failed() {
|
||||||
print_ok() {
|
print_ok() {
|
||||||
|
|
||||||
if [ "$COLORED_OUTPUT" -eq 1 ]; then
|
if [ "$COLORED_OUTPUT" -eq 1 ]; then
|
||||||
printf "$GREEN OK$NORMAL"
|
printf "%s OK%s" "$GREEN" "$NORMAL"
|
||||||
else
|
else
|
||||||
printf " OK"
|
printf " OK"
|
||||||
fi
|
fi
|
||||||
|
@ -134,9 +134,9 @@ print_warn() {
|
||||||
msg=$*
|
msg=$*
|
||||||
|
|
||||||
if [ "$COLORED_OUTPUT" -eq 1 ]; then
|
if [ "$COLORED_OUTPUT" -eq 1 ]; then
|
||||||
echo -e "$YELLOW[-]$NORMAL $msg"
|
echo "$YELLOW[-]$NORMAL $msg"
|
||||||
else
|
else
|
||||||
echo -e "[-] $msg"
|
echo "[-] $msg"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ trim_value() {
|
||||||
|
|
||||||
reset_values() {
|
reset_values() {
|
||||||
|
|
||||||
echo -e "\n[+] Initialisiere Felder für Rechnung neu."
|
printf "\n[+] Initialisiere Felder für Rechnung neu."
|
||||||
LINE_BUFFER=""
|
LINE_BUFFER=""
|
||||||
KEY_BUFFER=""
|
KEY_BUFFER=""
|
||||||
VALUE_BUFFER=""
|
VALUE_BUFFER=""
|
||||||
|
@ -208,7 +208,7 @@ set_value() {
|
||||||
make_invoice() {
|
make_invoice() {
|
||||||
|
|
||||||
dead_days="14"
|
dead_days="14"
|
||||||
if [ $(date +%u) -gt 5 ]; then
|
if [ "$(date +%u)" -gt 5 ]; then
|
||||||
dead_days="16"
|
dead_days="16"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -284,8 +284,9 @@ proced_ini_line() {
|
||||||
}
|
}
|
||||||
|
|
||||||
quit() {
|
quit() {
|
||||||
printf "\n$BLUE"
|
printf "\n"
|
||||||
printf "[-] Exit$NORMAL\n"
|
print "$BLUE"
|
||||||
|
printf "[-] Exit%s\n" "$NORMAL"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue