From da7697a5b03b4e98fca7839dca709c35ca7e24ac Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Fri, 27 Aug 2021 23:35:31 -0500 Subject: [PATCH] Cleanup - Update scripts to use bash instead of sh - Update docs --- docs/manage-users-zh.md | 10 +++++----- docs/manage-users.md | 10 +++++----- extras/add_vpn_user.sh | 2 +- extras/del_vpn_user.sh | 2 +- extras/update_vpn_users.sh | 2 +- extras/vpnupgrade_amzn.sh | 2 +- extras/vpnupgrade_centos.sh | 2 +- extras/vpnupgrade_ubuntu.sh | 2 +- vpnsetup_amzn.sh | 2 +- vpnsetup_centos.sh | 2 +- vpnsetup_ubuntu.sh | 2 +- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/manage-users-zh.md b/docs/manage-users-zh.md index 3615855..2eff5ec 100644 --- a/docs/manage-users-zh.md +++ b/docs/manage-users-zh.md @@ -58,9 +58,9 @@ wget -O add_vpn_user.sh https://bit.ly/addvpnuser ```bash # 所有变量值必须用 '单引号' 括起来 # *不要* 在值中使用这些字符: \ " ' -sudo sh add_vpn_user.sh '要添加的用户名' '密码' +sudo bash add_vpn_user.sh '要添加的用户名' '密码' # 或者 -sudo sh add_vpn_user.sh '要更新的用户名' '新密码' +sudo bash add_vpn_user.sh '要更新的用户名' '新密码' ``` ### 删除一个 VPN 用户 @@ -75,7 +75,7 @@ wget -O del_vpn_user.sh https://bit.ly/delvpnuser ```bash # 所有变量值必须用 '单引号' 括起来 # *不要* 在值中使用这些字符: \ " ' -sudo sh del_vpn_user.sh '要删除的用户名' +sudo bash del_vpn_user.sh '要删除的用户名' ``` ### 更新所有的 VPN 用户 @@ -96,7 +96,7 @@ wget -O update_vpn_users.sh https://bit.ly/updatevpnusers ```bash nano -w update_vpn_users.sh [替换为你自己的值: YOUR_USERNAMES 和 YOUR_PASSWORDS] -sudo sh update_vpn_users.sh +sudo bash update_vpn_users.sh ``` **选项 2:** 将 VPN 用户信息定义为环境变量: @@ -108,7 +108,7 @@ sudo sh update_vpn_users.sh sudo \ VPN_USERS='用户名1 用户名2 ...' \ VPN_PASSWORDS='密码1 密码2 ...' \ -sh update_vpn_users.sh +bash update_vpn_users.sh ``` ## 手动管理 VPN 用户 diff --git a/docs/manage-users.md b/docs/manage-users.md index ce69ee4..8d66b58 100644 --- a/docs/manage-users.md +++ b/docs/manage-users.md @@ -58,9 +58,9 @@ wget -O add_vpn_user.sh https://bit.ly/addvpnuser ```bash # All values MUST be placed inside 'single quotes' # DO NOT use these special characters within values: \ " ' -sudo sh add_vpn_user.sh 'username_to_add' 'password' +sudo bash add_vpn_user.sh 'username_to_add' 'password' # OR -sudo sh add_vpn_user.sh 'username_to_update' 'new_password' +sudo bash add_vpn_user.sh 'username_to_update' 'new_password' ``` ### Delete a VPN user @@ -75,7 +75,7 @@ wget -O del_vpn_user.sh https://bit.ly/delvpnuser ```bash # All values MUST be placed inside 'single quotes' # DO NOT use these special characters within values: \ " ' -sudo sh del_vpn_user.sh 'username_to_delete' +sudo bash del_vpn_user.sh 'username_to_delete' ``` ### Update all VPN users @@ -96,7 +96,7 @@ To use this script, choose one of the following options: ```bash nano -w update_vpn_users.sh [Replace with your own values: YOUR_USERNAMES and YOUR_PASSWORDS] -sudo sh update_vpn_users.sh +sudo bash update_vpn_users.sh ``` **Option 2:** Define VPN user details as environment variables: @@ -108,7 +108,7 @@ sudo sh update_vpn_users.sh sudo \ VPN_USERS='username1 username2 ...' \ VPN_PASSWORDS='password1 password2 ...' \ -sh update_vpn_users.sh +bash update_vpn_users.sh ``` ## Manually manage VPN users diff --git a/extras/add_vpn_user.sh b/extras/add_vpn_user.sh index 140541b..1b06478 100755 --- a/extras/add_vpn_user.sh +++ b/extras/add_vpn_user.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Script to add/update a VPN user for both IPsec/L2TP and Cisco IPsec # diff --git a/extras/del_vpn_user.sh b/extras/del_vpn_user.sh index a0dadda..9398a00 100755 --- a/extras/del_vpn_user.sh +++ b/extras/del_vpn_user.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Script to delete a VPN user for both IPsec/L2TP and Cisco IPsec # diff --git a/extras/update_vpn_users.sh b/extras/update_vpn_users.sh index 0195e14..6a812ba 100755 --- a/extras/update_vpn_users.sh +++ b/extras/update_vpn_users.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Script to update VPN users for both IPsec/L2TP and Cisco IPsec # diff --git a/extras/vpnupgrade_amzn.sh b/extras/vpnupgrade_amzn.sh index a60600d..5ca249f 100755 --- a/extras/vpnupgrade_amzn.sh +++ b/extras/vpnupgrade_amzn.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Script to update Libreswan on Amazon Linux 2 # diff --git a/extras/vpnupgrade_centos.sh b/extras/vpnupgrade_centos.sh index 72096e1..4bb413f 100755 --- a/extras/vpnupgrade_centos.sh +++ b/extras/vpnupgrade_centos.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Script to update Libreswan on CentOS and RHEL # diff --git a/extras/vpnupgrade_ubuntu.sh b/extras/vpnupgrade_ubuntu.sh index 8a12a14..02e436d 100755 --- a/extras/vpnupgrade_ubuntu.sh +++ b/extras/vpnupgrade_ubuntu.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Script to update Libreswan on Ubuntu and Debian # diff --git a/vpnsetup_amzn.sh b/vpnsetup_amzn.sh index 6e68bb2..4a06d00 100755 --- a/vpnsetup_amzn.sh +++ b/vpnsetup_amzn.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Script for automatic setup of an IPsec VPN server on Amazon Linux 2 # Works on any dedicated server or virtual private server (VPS) diff --git a/vpnsetup_centos.sh b/vpnsetup_centos.sh index cebe57d..44f9b73 100755 --- a/vpnsetup_centos.sh +++ b/vpnsetup_centos.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Script for automatic setup of an IPsec VPN server on CentOS and RHEL # Works on any dedicated server or virtual private server (VPS) diff --git a/vpnsetup_ubuntu.sh b/vpnsetup_ubuntu.sh index 662d9e4..4b5e506 100755 --- a/vpnsetup_ubuntu.sh +++ b/vpnsetup_ubuntu.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Script for automatic setup of an IPsec VPN server on Ubuntu and Debian # Works on any dedicated server or virtual private server (VPS)