From: Julian Ospald <hasufell@gentoo.org>
Date: Tue Feb 19 21:24:39 UTC 2013
Subject: make scripts POSIX compliant

--- teamviewer7/.tvscript/.regedit
+++ teamviewer7/.tvscript/.regedit
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 TV_script_dir="$(dirname "$(readlink -f "$0")")"
 "$TV_script_dir/wrapper" wine regedit "$@"
--- teamviewer7/.tvscript/.winecfg
+++ teamviewer7/.tvscript/.winecfg
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 TV_script_dir="$(dirname "$(readlink -f "$0")")"
 "$TV_script_dir/wrapper" wine winecfg "$@"
--- teamviewer7/.tvscript/killteamviewer
+++ teamviewer7/.tvscript/killteamviewer
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #  execute wineserver -k for all users running a TeamViewer
 #  (if not called by root, only successful for the current user)
 
--- teamviewer7/.tvscript/teamviewer
+++ teamviewer7/.tvscript/teamviewer
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 TV_script_dir="$(dirname "$(readlink -f "$0")")"
 "$TV_script_dir/wrapper" wine "c:\Program Files\TeamViewer\Version7\TeamViewer.exe" "$@"
--- teamviewer7/.tvscript/wrapper
+++ teamviewer7/.tvscript/wrapper
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 TV_script_dir="$(dirname "$(readlink -f "$0")")"
 TV_base_dir="$(dirname "$TV_script_dir")"
@@ -23,7 +23,7 @@
 export WINESERVER="$TV_Wine_bin/wineserver"
 
 
-function tv_Prepare()
+tv_Prepare()
 {
   exec 2>&1				# redirect stderr
 
@@ -33,7 +33,7 @@
   setup_env
 }
 
-function tv_Run()
+tv_Run()
 {
   exec 2>&1				# redirect stderr
 
@@ -43,7 +43,7 @@
   "$TV_Wine_bin/$binary" "$@"
 }
 
-function tv_LogInfo()
+tv_LogInfo()
 {
   exec 2>&1					# redirect stderr
 
@@ -71,7 +71,7 @@
   echo " "
 }
 
-function setup_wine()
+setup_wine()
 {
   # setup dosdevices and symlinks
   local c_sym="$WINEPREFIX/dosdevices/c:"
@@ -88,14 +88,14 @@
 }
 
 # ensure path exists
-function make_path()
+make_path()
 {
   local path="$1"
   [ -d "$path" ] || mkdir -p "$path" || die "Could not create $path"
 }
 
 # setup/validate drive symlinks
-function setup_drive_symlink()
+setup_drive_symlink()
 {
   local sym="$1"
   local dst="$2"
@@ -107,7 +107,7 @@
 }
 
 # setup logfile symlinks
-function setup_log_symlink
+setup_log_symlink()
 {
   local cuser=$(id -un)
   local basepath="$WINEPREFIX/drive_c/users/$cuser"
@@ -129,7 +129,7 @@
 }
 
 # setup/validate win symlinks
-function setup_win_symlink()
+setup_win_symlink()
 {
   local sym="$WINEPREFIX/$1"
   local dst="$TV_Wine_dir/$1"
@@ -141,7 +141,7 @@
   [ -d $(readlink -f "$sym") ] || ln -s "$dst" "$sym" || die "Could not create $sym (link to $dst)"
 }
 
-function setup_prog_dir()
+setup_prog_dir()
 {
   local progdir="$WINEPREFIX/drive_c/Program Files/TeamViewer/Version7"
   local progsrc="$TV_Wine_dir/drive_c/Program Files/TeamViewer/Version7"
@@ -158,7 +158,7 @@
   done
 }
 
-function setup_wine_tweaks()
+setup_wine_tweaks()
 {
   # Enable Subpixel Hinting
   if ! [ -e "$WINEPREFIX/.set_fontsmooth" ] ; then
@@ -191,7 +191,7 @@
   fi
 }
 
-function setup_tar_env()
+setup_tar_env()
 {
   local dsrc="$TV_script_dir/teamviewer.desktop.template"
   local ddst="$TV_script_dir/teamviewer.desktop"
@@ -210,7 +210,7 @@
   fi
 }
 
-function setup_env()
+setup_env()
 {
   local tvwine="$TV_Wine_dir/drive_c/Program Files/TeamViewer/Version7/tvwine.dll.so"
 
@@ -227,7 +227,7 @@
   (cd /etc; ls -m *-release *-version *_version > "$TV_profile/drive_c/distrelease" 2> /dev/null)
 }
 
-function validate_user()
+validate_user()
 {
   local userid=$(id -un)
 
@@ -236,7 +236,7 @@
   fi
 }
 
-function validate_binary()
+validate_binary()
 {
   local binary="$1"
 
@@ -245,9 +245,11 @@
   fi
 }
 
-function die()
+die()
 {
-  echo -e "\nError: $@\n"
+  echo
+  echo "Error: $@"
+  echo
   exit 1
 }