diff --git a/src/lib/ee_lib_git.sh b/src/lib/ee_lib_git.sh index 7f050dc4..3467c90e 100644 --- a/src/lib/ee_lib_git.sh +++ b/src/lib/ee_lib_git.sh @@ -3,22 +3,24 @@ function ee_lib_git() { for ee_git_dir in ${@:1:$(($#-1))}; do - # Change directory - cd $ee_git_dir || ee_lib_error "Unable to change directory $ee_git_dir, exit status = " $? + if [ -d $ee_git_dir ]; then + # Change directory + cd $ee_git_dir - # Check .git - if [ ! -d .git ]; then - # ee_lib_echo "Initialize Git on ${ee_git_dir}" - git init &>> $EE_COMMAND_LOG \ - || ee_lib_error "Unable to initialize Git on $ee_git_dir, exit status = " $? - fi + # Check .git + if [ ! -d .git ]; then + # ee_lib_echo "Initialize Git on ${ee_git_dir}" + git init &>> $EE_COMMAND_LOG \ + || ee_lib_error "Unable to initialize Git on $ee_git_dir, exit status = " $? + fi - # Check for untracked files - if [ $(git status -s | wc -l) -ne 0 ]; then - # Add files in Git version control - ee_lib_echo "Git commit on $ee_git_dir, please wait..." - git add --all && git commit -am "${@: -1}" &>> $EE_COMMAND_LOG \ - || ee_lib_error "Unable to Git commit on $ee_git_dir, exit status = " $? + # Check for untracked files + if [ $(git status -s | wc -l) -ne 0 ]; then + # Add files in Git version control + ee_lib_echo "Git commit on $ee_git_dir, please wait..." + git add --all && git commit -am "${@: -1}" &>> $EE_COMMAND_LOG \ + || ee_lib_error "Unable to Git commit on $ee_git_dir, exit status = " $? + fi fi done } diff --git a/src/lib/ee_lib_service.sh b/src/lib/ee_lib_service.sh index 55660ddb..6ec5dcc2 100644 --- a/src/lib/ee_lib_service.sh +++ b/src/lib/ee_lib_service.sh @@ -7,8 +7,7 @@ function ee_lib_service() { for ee_service_name in ${@:1:$(($#-1))}; do - dpkg --get-selections | grep -v deinstall | grep $ee_service_name &>> $EE_COMMAND_LOG - if [ $? -eq 0 ];then + if [ -f /etc/init.d/$ee_service_name ];then # Display message ee_lib_echo "Executing service $ee_service_name ${@: -1}, please wait..."