Permalink
Browse files

Add rc_halt() to our SH functions, remove it from pc-updatemanager

  • Loading branch information...
1 parent 629cca3 commit 65fd04b2c0ac0440f780436b36b2ccb4b455f646 @kmoore134 kmoore134 committed Aug 22, 2013
Showing with 28 additions and 28 deletions.
  1. +28 −0 src-sh/libsh/functions.sh
  2. +0 −28 src-sh/pc-updatemanager/pc-updatemanager
View
@@ -637,3 +637,31 @@ run_firstboot()
rm /var/.pcbsd-firstgui
fi
}
+
+# Run-command, don't halt if command exits with non-0
+rc_nohalt()
+{
+ CMD="$1"
+
+ if [ -z "${CMD}" ] ; then
+ exit_err "Error: missing argument in rc_nohalt()"
+ fi
+
+ ${CMD}
+}
+
+# Run-command, halt if command exits with non-0
+rc_halt()
+{
+ CMD="$@"
+
+ if [ -z "${CMD}" ] ; then
+ exit_err "Error: missing argument in rc_halt()"
+ fi
+
+ ${CMD}
+ STATUS=$?
+ if [ ${STATUS} -ne 0 ] ; then
+ exit_err "Error ${STATUS}: ${CMD}"
+ fi
+}
@@ -78,34 +78,6 @@ show_usage() {
exit 1
}
-# Run-command, don't halt if command exits with non-0
-rc_nohalt()
-{
- CMD="$1"
-
- if [ -z "${CMD}" ] ; then
- exit_err "Error: missing argument in rc_nohalt()"
- fi
-
- ${CMD}
-}
-
-# Run-command, halt if command exits with non-0
-rc_halt()
-{
- CMD="$@"
-
- if [ -z "${CMD}" ] ; then
- exit_err "Error: missing argument in rc_halt()"
- fi
-
- ${CMD}
- STATUS=$?
- if [ ${STATUS} -ne 0 ] ; then
- exit_err "Error ${STATUS}: ${CMD}"
- fi
-}
-
get_update_file() {
# Now fetch the update file

0 comments on commit 65fd04b

Please sign in to comment.