mirror of
https://github.com/easy-wi/developer.git
synced 2025-02-20 11:23:28 +08:00
line 491: [: argument expected
This commit is contained in:
parent
8bc0385ca1
commit
0912e542f8
@ -260,7 +260,7 @@ if [ -f /etc/debian_version ]; then
|
|||||||
else
|
else
|
||||||
apt-get install proftpd
|
apt-get install proftpd
|
||||||
fi
|
fi
|
||||||
if [ "`grep '<Directory ~\/server\/\*\/mc\/\*>' /etc/proftpd/proftpd.conf`" == "" ]; then
|
if [ "`grep '<Directory \/home\/\*\/pserver\/\*>' /etc/proftpd/proftpd.conf`" == "" ]; then
|
||||||
echo '
|
echo '
|
||||||
DefaultRoot ~
|
DefaultRoot ~
|
||||||
|
|
||||||
@ -488,7 +488,7 @@ echo "The setup is finished"
|
|||||||
}
|
}
|
||||||
|
|
||||||
function publicKeyGenerate {
|
function publicKeyGenerate {
|
||||||
if [ "`id -u`" == "0" -a -z $INSTALLMASTER ]; then
|
if ([ "`id -u`" == "0" ] && [ -z $INSTALLMASTER ]); then
|
||||||
INSTALLMASTER=`find /home/*/control.sh -maxdepth 1 | awk -F '/' '{print $3}' | head -n 1`
|
INSTALLMASTER=`find /home/*/control.sh -maxdepth 1 | awk -F '/' '{print $3}' | head -n 1`
|
||||||
elif [ "`id -u`" != "0" ]; then
|
elif [ "`id -u`" != "0" ]; then
|
||||||
INSTALLMASTER=`whoami`
|
INSTALLMASTER=`whoami`
|
||||||
@ -501,10 +501,15 @@ function publicKeyGenerate {
|
|||||||
ssh-keygen -t rsa
|
ssh-keygen -t rsa
|
||||||
fi
|
fi
|
||||||
cd /home/$INSTALLMASTER/.ssh
|
cd /home/$INSTALLMASTER/.ssh
|
||||||
if [ "`id -u`" == "0" ]; then
|
KEYNAME=`find -maxdepth 1 -name "*.pub" | head -n 1`
|
||||||
su -c 'cat id_rsa.pub >> authorized_keys' $INSTALLMASTER
|
if [ "$KEYNAME" != "" ]; then
|
||||||
|
if [ "`id -u`" == "0" ]; then
|
||||||
|
su -c "cat $KEYNAME >> authorized_keys" $INSTALLMASTER
|
||||||
|
else
|
||||||
|
cat $KEYNAME >> authorized_keys
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
cat id_rsa.pub >> authorized_keys
|
echo "Error: could not find a key"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user