forked from cosmic/cosmic
better names for cosmic admin utils
This commit is contained in:
parent
79b8b16c15
commit
d15faeb607
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
|
||||
run_user=$(id -u)
|
||||
if [ "$run_user" -eq 0 ]; then
|
||||
n="$1"
|
||||
s="$2"
|
||||
if [ ! -z "$n" ]; then
|
||||
user_exists=$(id -u "${n}" 2> /dev/null)
|
||||
if [ ! -z "${user_exists}" ]; then
|
||||
if [ ! -z "${s}" ]; then
|
||||
printf "Creating ship '%s' for user '%s'\\n" "${s}" "${n}"
|
||||
else
|
||||
printf "Specificy a ship or colony name.\\n"
|
||||
fi
|
||||
else
|
||||
printf "User not found.\\n"
|
||||
fi
|
||||
else
|
||||
printf "Specify a user.\\n"
|
||||
fi
|
||||
else
|
||||
printf "You must be root to run this script.\\n"
|
||||
fi
|
|
@ -5,8 +5,12 @@ DIR="$( cd "$( dirname "$0" )" && pwd )"
|
|||
# Fix path in case of symlinks
|
||||
DIR=$(cd "$DIR" && pwd -P)
|
||||
|
||||
if [ ! -L "/usr/local/bin/cosmicuser" ]; then
|
||||
ln -s "${DIR}/cosmicuser" "/usr/local/bin/cosmicuser"
|
||||
if [ ! -L "/usr/local/bin/cosmic-user" ]; then
|
||||
ln -s "${DIR}/cosmic-user" "/usr/local/bin/cosmic-user"
|
||||
fi
|
||||
|
||||
if [ ! -L "/usr/local/bin/cosmic-ship" ]; then
|
||||
ln -s "${DIR}/cosmic-ship" "/usr/local/bin/cosmic-ship"
|
||||
fi
|
||||
|
||||
if [ ! -L "/usr/local/bin/log" ]; then
|
||||
|
|
Loading…
Reference in New Issue