092c0d3a19
* cleaned up the version and now using the pro version since the old version dosn't appear on the site anymore * moved from /usr/share/yacy to /usr/lib/yacy, as a result if you have a existing install please move /usr/share/yacy/DATA to /usr/lib/yacy/DATA * removed alot of junk files and source code * cleaned up pre-install and README
43 lines
884 B
Bash
43 lines
884 B
Bash
#!/bin/sh
|
|
|
|
# Created by Danny Rawlins, <romster at shortcircuit dot net dot au>
|
|
|
|
GROUP=daemon
|
|
USER=_yacy
|
|
USER_COMMENT="Yacy Daemon"
|
|
USER_HOME=/var/empty
|
|
USER_SHELL=/bin/sh
|
|
|
|
if [ ! $(id -u) = 0 ]; then
|
|
echo "ERROR: you need to be root to run this!"
|
|
exit 1
|
|
fi
|
|
|
|
if [ $GROUP ]; then
|
|
if ! getent group $GROUP > /dev/null; then
|
|
/usr/sbin/groupadd $GROUP
|
|
if [ $? -eq 0 ]; then
|
|
echo "Group: $GROUP added."
|
|
fi
|
|
else
|
|
echo "Group: $GROUP already exists! Skipping."
|
|
fi
|
|
fi
|
|
|
|
if ! getent passwd $USER > /dev/null; then
|
|
/usr/sbin/useradd -g $GROUP -c "$USER_COMMENT" -d $USER_HOME -s $USER_SHELL $USER
|
|
if [ $? -eq 0 ]; then
|
|
echo "User: $USER added."
|
|
/usr/bin/passwd -l $USER
|
|
if [ $? -eq 0 ]; then
|
|
echo "Locked $USER account."
|
|
fi
|
|
else
|
|
echo "ERROR: unable to lock $USER account."
|
|
/usr/sbin/userdel $USER
|
|
fi
|
|
else
|
|
echo "User: $USER already exists! Skipping."
|
|
fi
|
|
|