#!/bin/sh
[ "$(whoami)" != 'root' ] && ( echo you are using a non-privileged account; exit 1 )

if  [ "$1" == 'copyTempSystem' ]; then cp /home/user/.CSSUfeatures/CSSUfeatures_temp_system /usr/share/hildon-desktop/transitions.ini; fi  
if  [ "$1" == 'copyTempTheme' ]; then cp /home/user/.CSSUfeatures/CSSUfeatures_temp_theme /etc/hildon/theme/transitions.ini; fi  
if  [ "$1" == 'copyDefault' ]; then cp /usr/share/hildon-desktop/transitions.ini.default /usr/share/hildon-desktop/transitions.ini; fi  
if  [ "$1" == 'rebootDevice' ]; then sleep 5; reboot; fi

#add/remove entry in the power key menu
if  [ "$1" == 'addPowerKeyEntry' ]; then ln -s /opt/CSSUfeatures/CSSUfeatures.xml /etc/systemui/CSSUfeatures.xml; fi  
if  [ "$1" == 'deletePowerKeyEntry' ]; then rm /etc/systemui/CSSUfeatures.xml; fi  
if  [ "$1" == 'updatePowerKeyEntry' ]; then killall systemui; fi 