Move root user check to linux shell script
This commit is contained in:
parent
24840717bf
commit
e5948745ee
|
@ -45,16 +45,6 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public static void Main (string [] args)
|
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
|
// Parse the command line options
|
||||||
bool show_help = false;
|
bool show_help = false;
|
||||||
OptionSet option_set = new OptionSet () {
|
OptionSet option_set = new OptionSet () {
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
#!/bin/bash
|
#!/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
|
if [ "$XDG_RUNTIME_DIR" ]; then
|
||||||
pidfile=${XDG_RUNTIME_DIR}/sparkleshare.pid
|
pidfile=${XDG_RUNTIME_DIR}/sparkleshare.pid
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue