diff --git a/run-git.sh b/run-git.sh index 3d2897a..960591a 100755 --- a/run-git.sh +++ b/run-git.sh @@ -2,12 +2,12 @@ echo 'Starting gogs git service in screen...' #screen -dmS gogs #screen -S gogs -X stuff "/root/gogs/gogs web\n" cd ~/git/ -pm2 start -x './gogs/gogs' -n git.gogs -- web +sudo pm2 start -x './gogs/gogs' -n git.gogs -- web # sudo it so that pm2 list shows it as root cd ~ echo 'Starting http2https web service in pm2...' cd ~/git/www -pm2 start server.js --name git.http2https +sudo pm2 start server.js --name git.http2https # sudo it so that pm2 list shows it as root cd ~/ echo 'Done!' diff --git a/setup-debian.sh b/setup-debian.sh index c4ad75a..0c4e050 100644 --- a/setup-debian.sh +++ b/setup-debian.sh @@ -35,11 +35,11 @@ sed -i "s/^PermitRootLogin yes/#PermitRootLogin yes/g" /etc/ssh/sshd_config service sshd restart echo ">>> set autostart" +mv /etc/rc.local /etc/rc.local.backup touch /etc/rc.local chmod +x /etc/rc.local -echo "#!/bin/bash" -echo "exec /root/autostart.sh" -echo "exit 0" +echo '#!/bin/bash' > /etc/local # can't omit, otherwise you can't launch pm2 in autostart.sh. Don't use double quote here, otherwise error. +echo 'source /root/autostart.sh' >> /etc/rc.local # make sure to sudo pm2 in autostart.sh, otherwise pm2 list can't find it as root. touch /root/autostart.sh chmod +x /root/autostart.sh diff --git a/setup-home.sh b/setup-home.sh index e62e649..3516231 100644 --- a/setup-home.sh +++ b/setup-home.sh @@ -10,4 +10,5 @@ ln -s ~/linux.config/.emacs.lisp ~/ ln -s ~/linux.config/.bashrc ~/ ln -s ~/linux.config/.bash_profile ~/ . ~/.bashrc +git config --global confidential.helper cache echo "######## 完毕 ##################"