Move root user check to linux shell script

This commit is contained in:
Hylke Bons 2011-09-20 18:46:36 +01:00
parent 24840717bf
commit e5948745ee
2 changed files with 5 additions and 10 deletions

View file

@ -45,16 +45,6 @@ namespace SparkleShare {
public static void Main (string [] args)
{
// Don't allow running as root on Linux or Mac
/* if ((SparkleBackend.Platform == PlatformID.Unix ||
SparkleBackend.Platform == PlatformID.MacOSX) &&
new UnixUserInfo (UnixEnvironment.UserName).UserId == 0) {
Console.WriteLine (_("Sorry, you can't run SparkleShare with these permissions."));
Console.WriteLine (_("Things would go utterly wrong."));
Environment.Exit (-1);
}
*/
// Parse the command line options
bool show_help = false;
OptionSet option_set = new OptionSet () {

View file

@ -1,5 +1,10 @@
#!/bin/bash
if [[ $UID -e 0 ]]; then
echo "Cannot run as root. Things would go utterly wrong."
exit 1
fi
if [ "$XDG_RUNTIME_DIR" ]; then
pidfile=${XDG_RUNTIME_DIR}/sparkleshare.pid
else