Skip to content
Browse files

Ignore error codes for empty ls response (for `set -e` shell flag).

  • Loading branch information...
1 parent 72fe822 commit 836aeb7b4fde40b8cb2eaacceee07c6af0f06bcf @nigma committed Jun 26, 2012
Showing with 12 additions and 10 deletions.
  1. +12 −10 123 - lib-system-ubuntu.sh
View
22 123 - lib-system-ubuntu.sh
@@ -84,6 +84,8 @@ function system_update_hostname {
function system_security_logcheck {
aptitude -y install logcheck logcheck-database
+ # configure email
+ # start after setup
}
function system_security_fail2ban {
@@ -119,19 +121,19 @@ EOF
}
function restart_services {
- # restarts upstart services that have a file in /tmp/needs-restart/
- for service_name in $(ls /tmp/restart-* | cut -d- -f2-10); do
- service $service_name restart
- rm -f /tmp/restart-$service_name
- done
+ # restarts upstart services that have a file in /tmp/needs-restart/
+ for service_name in $(ls /tmp/ | grep restart-* | cut -d- -f2-10); do
+ service $service_name restart
+ rm -f /tmp/restart-$service_name
+ done
}
function restart_initd_services {
- # restarts upstart services that have a file in /tmp/needs-restart/
- for service_name in $(ls /tmp/restart_initd-* | cut -d- -f2-10); do
- /etc/init.d/$service_name restart
- rm -f /tmp/restart_initd-$service_name
- done
+ # restarts upstart services that have a file in /tmp/needs-restart/
+ for service_name in $(ls /tmp/ | grep restart_initd-* | cut -d- -f2-10); do
+ /etc/init.d/$service_name restart
+ rm -f /tmp/restart_initd-$service_name
+ done
}
# Maintain for compatibility with scripts using this library for Ubuntu 10.04

0 comments on commit 836aeb7

Please sign in to comment.
Something went wrong with that request. Please try again.