#!/bin/sh
# Author: Blake, Kuo-Lien Huang
# License: GPL
# Description:
#  client mode switch.

# must be root
ID=`id -u`
if [ "$ID" != "0" ]; then
  echo "You must be root to use this script."
  echo "Use sudo to enable it for users."
  exit 1
fi

if [ "$1" = "-h" -o "$1" = "--help" ]; then
  if [ -f /opt/drbl/sbin/drblpush-desktop ]; then
    export GPL=0; /opt/drbl/sbin/drblpush-desktop --client-switch other
  else
    export GPL=0; drblpush-desktop --client-switch other
  fi
  exit 0
fi

if [ -f /opt/drbl/sbin/drblpush-desktop ]; then
  export GPL=0; /opt/drbl/sbin/drblpush-desktop --client-switch $1
else
  export GPL=0; drblpush-desktop --client-switch
fi 
