summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Levand <geoffrey.levand@am.sony.com>2008-01-06 15:54:34 -0800
committerGeoff Levand <geoffrey.levand@am.sony.com>2008-01-06 15:54:34 -0800
commit259815714229a3f579e9ba8b08e27479d3258c74 (patch)
tree25cf821f31a96bfe833813a51207b1dd04013828
parent57bae399de01c5efaadd5adf423f93043ba13659 (diff)
downloadps3-utils-259815714229a3f579e9ba8b08e27479d3258c74.tar.gz
ps3-boot-game-os.in: Add options --poweroff, --no-reboot. Cleanup help text.
-rw-r--r--ps3-boot-game-os.in60
-rw-r--r--ps3-dump-bootloader.in3
2 files changed, 49 insertions, 14 deletions
diff --git a/ps3-boot-game-os.in b/ps3-boot-game-os.in
index 4e0378a..6bd4475 100644
--- a/ps3-boot-game-os.in
+++ b/ps3-boot-game-os.in
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# PS3 set boot flag and reboot to game OS.
+# Set the PS3 boot flag and reboot to game OS.
#
# Copyright (C) 2006 Sony Computer Entertainment Inc.
# Copyright 2006 Sony Corp.
@@ -19,20 +19,56 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-if [ "x${1}" != "x" ]; then
- echo "ps3-boot-game-os (@PACKAGE_NAME@) @PACKAGE_VERSION@"
- echo ""
- echo "DESCRIPTION"
- echo " Set the boot flag and reboot to game OS"
- echo ""
- echo "Send bug reports to @PACKAGE_BUGREPORT@"
- echo ""
- exit 0
-fi
+usage() {
+ echo "ps3-boot-game-os (@PACKAGE_NAME@) @PACKAGE_VERSION@" >&2
+ echo "" >&2
+ echo "DESCRIPTION" >&2
+ echo " Set the PS3 boot flag and reboot to game OS" >&2
+ echo "" >&2
+ echo "OPTIONS" >&2
+ echo " -h, --help" >&2
+ echo " Print a help message." >&2
+ echo "" >&2
+ echo " -n, --no-reboot" >&2
+ echo " Don't reboot system after setting boot flag." >&2
+ echo "" >&2
+ echo " -p, --poweroff" >&2
+ echo " Poweroff system after setting boot flag." >&2
+ echo "" >&2
+ echo "Send bug reports to @PACKAGE_BUGREPORT@" >&2
+ echo "" >&2
+ exit 1
+}
+
+cmd="reboot"
+
+while [ "$#" -gt 0 ]; do
+ case "$1" in
+ -n | --no-reboot)
+ cmd="no-reboot"
+ ;;
+ -p | --poweroff)
+ cmd="poweroff"
+ ;;
+ *)
+ usage
+ ;;
+ esac
+ shift
+done
+
if ! @prefix@/sbin/ps3-flash-util -g ; then
echo "ERROR: can't change boot flag" 2>&1;
exit 1;
fi
-reboot
+echo $cmd 2>&1;
+
+if [ $cmd = "poweroff" ]; then
+ poweroff
+elif [ $cmd = "no-reboot" ]; then
+ exit 0
+else
+ reboot
+fi
diff --git a/ps3-dump-bootloader.in b/ps3-dump-bootloader.in
index b5ff2cb..c0a9b44 100644
--- a/ps3-dump-bootloader.in
+++ b/ps3-dump-bootloader.in
@@ -32,7 +32,6 @@ usage() {
echo " -s, --sum" >&2
echo " Compute the md5sum and print it to stdout." >&2
echo "" >&2
- echo "" >&2
echo "Send bug reports to @PACKAGE_BUGREPORT@" >&2
echo "" >&2
exit 1
@@ -42,7 +41,7 @@ sum=
while [ "$#" -gt 0 ]; do
case "$1" in
- --sum|-s)
+ --sum | -s)
sum="y"
;;
*)