diff --git a/exec-add-rsapub-to-remote.sh b/exec-add-rsapub-to-remote.sh new file mode 100644 index 0000000..e33e33d --- /dev/null +++ b/exec-add-rsapub-to-remote.sh @@ -0,0 +1,10 @@ +if [ $1 ] +then + REMOTEHOST=$1 +else + read -p "Enter user@remotehost " REMOTEHOST +fi + +scp ~/.ssh/id_rsa.pub $REMOTEHOST:~/tmp.pub + +ssh $REMOTEHOST "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat ~/tmp.pub >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys && rm -f ~/tmp.pub" diff --git a/gitpullall.sh b/exec-git-pull-all.sh similarity index 75% rename from gitpullall.sh rename to exec-git-pull-all.sh index 1ad5e90..e4bd7fa 100644 --- a/gitpullall.sh +++ b/exec-git-pull-all.sh @@ -1,5 +1,13 @@ #!/bin/bash +if [ $1 ] +then + FONPATH=$1 +else + read -p "Enter path-to-faronear " FONPATH +fi + +pushd $FONPATH for org in `ls .` do if [ -d $org ] @@ -18,3 +26,4 @@ do cd ..; fi done +popd \ No newline at end of file diff --git a/exec-rsync2remote.sh b/exec-rsync2remote.sh index 5359106..f4ff96b 100644 --- a/exec-rsync2remote.sh +++ b/exec-rsync2remote.sh @@ -1 +1,15 @@ -rsync -rvz -e ssh -p 22000 --progress ./git.repo adot@west-cn.yuanjin.net:/home/adot/ +if [ $1 ] +then + LOCALPATH=$1 +else + read -p "Enter localpath " LOCALPATH +fi + +if [ $2 ] +then + REMOTEPATH=$2 +else + read -p "Enter user@remotehost:path " REMOTEPATH +fi + +echo rsync -rvz -e ssh -p 22000 --progress $LOCALPATH $REMOTEHOST diff --git a/setup-debian.sh b/setup-debian.sh index b757977..57d2d08 100644 --- a/setup-debian.sh +++ b/setup-debian.sh @@ -44,6 +44,7 @@ useradd $User passwd $User mkdir /home/$User chown $User:$User /home/$User +chmod 700 /home/$User # emacs /etc/passwd # Debian 10 default to /bin/sh sed -i "s/\/home\/$User:\/bin\/sh$/\/home\/$User:\/bin\/bash/g" /etc/passwd