Compare commits
3 Commits
f35d41bc3a
...
1326629bcb
Author | SHA1 | Date | |
---|---|---|---|
|
1326629bcb | ||
|
282b210af9 | ||
|
a1a329738f |
@ -61,7 +61,7 @@ if ufw status | grep -q "Status: active"; then
|
||||
systemctl restart ufw
|
||||
fi
|
||||
|
||||
if [ ! -f /etc/openvpn/myserver.conf ] || [[ " $@ " == *" --force "* ]]; then
|
||||
if [ ! -f /etc/openvpn/server/myserver.conf ] || [[ " $@ " == *" --force "* ]]; then
|
||||
read -n 1 -p "Do you want to use username and password for login (y/N)? " answer
|
||||
if [[ ! -z "$answer" && "${answer^^}"=="Y" ]]; then
|
||||
EXTRA_CONFIG=$(cat <<-END
|
||||
@ -74,16 +74,16 @@ END
|
||||
)
|
||||
fi
|
||||
|
||||
tee /etc/openvpn/myserver.conf > /dev/null <<EOL
|
||||
tee /etc/openvpn/server/myserver.conf > /dev/null <<EOL
|
||||
#public-host $VPN_PUBLIC_HOST
|
||||
port $VPN_PUBLIC_PORT
|
||||
proto udp
|
||||
dev tun
|
||||
|
||||
ca ca.crt
|
||||
cert myservername.crt
|
||||
key myservername.key
|
||||
dh dh.pem
|
||||
ca ../ca.crt
|
||||
cert ../myservername.crt
|
||||
key ../myservername.key
|
||||
dh ../dh.pem
|
||||
|
||||
server $VPN_SUBNET.0 255.255.255.0 nopool
|
||||
ifconfig-pool-persist /var/log/openvpn/ipp.txt
|
||||
@ -95,7 +95,7 @@ push "route $LAN_SUBNET.0 255.255.255.0"
|
||||
$EXTRA_CONFIG
|
||||
|
||||
keepalive 10 120
|
||||
tls-auth ta.key 0
|
||||
tls-auth ../ta.key 0
|
||||
cipher AES-256-CBC
|
||||
persist-key
|
||||
persist-tun
|
||||
@ -134,16 +134,16 @@ for i in {1..255}; do
|
||||
break
|
||||
fi
|
||||
done
|
||||
VPN_SUBNET=$(grep -E '^server ' "/etc/openvpn/myserver.conf" | awk '{print $2}')
|
||||
VPN_PUBLIC_HOST=$(grep -E '^#public-host ' "/etc/openvpn/myserver.conf" | awk '{print $2}')
|
||||
VPN_PUBLIC_PORT=$(grep -E '^port ' "/etc/openvpn/myserver.conf" | awk '{print $2}')
|
||||
VPN_SUBNET=$(grep -E '^server ' "/etc/openvpn/server/myserver.conf" | awk '{print $2}')
|
||||
VPN_PUBLIC_HOST=$(grep -E '^#public-host ' "/etc/openvpn/server/myserver.conf" | awk '{print $2}')
|
||||
VPN_PUBLIC_PORT=$(grep -E '^port ' "/etc/openvpn/server/myserver.conf" | awk '{print $2}')
|
||||
echo "Adding VPN client to $VPN_PUBLIC_HOST:$VPN_PUBLIC_PORT"
|
||||
read -e -p "Enter client name: " -i "$CLIENT_NAME" CLIENT_NAME
|
||||
if [ -f "/etc/openvpn/easy-rsa/pki/issued/$CLIENT_NAME.crt" ]; then
|
||||
echo Client $CLIENT_NAME already exists...
|
||||
exit 1
|
||||
fi
|
||||
if grep -q "^auth-user-pass-verify" "/etc/openvpn/myserver.conf"; then
|
||||
if grep -q "^auth-user-pass-verify" "/etc/openvpn/server/myserver.conf"; then
|
||||
read -e -p "Enter username: " -i "$CLIENT_NAME" CLIENT_USERNAME
|
||||
if grep -i -q "^$CLIENT_USERNAME" "/etc/openvpn/credentials"; then
|
||||
echo "Username $CLIENT_USERNAME already exists"
|
||||
@ -172,7 +172,7 @@ CLIENT_KEY=$(cat "/etc/openvpn/easy-rsa/pki/private/$CLIENT_NAME.key")
|
||||
TA_KEY=$(cat "/etc/openvpn/ta.key")
|
||||
|
||||
cd "$DIR"
|
||||
cat > $CLIENT_NAME.conf <<EOL
|
||||
cat > $CLIENT_NAME.conf.save <<EOL
|
||||
dev tun
|
||||
persist-tun
|
||||
persist-key
|
||||
|
@ -87,14 +87,45 @@ if %ERRORLEVEL% EQU 1 (
|
||||
echo You must restart the computer before changes are in effect.
|
||||
)
|
||||
|
||||
choice /C yn /M "Disable adds?"
|
||||
choice /C yn /M "Disable adds for Windows 10 / Windows 11?"
|
||||
if %ERRORLEVEL% EQU 1 (
|
||||
echo Disabling adds
|
||||
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v Start_IrisRecommendations /t REG_DWORD /d 0 /f >nul 2>&1
|
||||
:: Disable Start Menu suggestions
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SystemPaneSuggestionsEnabled /t REG_DWORD /d 0 /f >nul 2>&1
|
||||
:: Disable lock screen ads (Spotlight)
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v RotatingLockScreenEnabled /t REG_DWORD /d 0 /f >nul 2>&1
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v RotatingLockScreenOverlayEnabled /t REG_DWORD /d 0 /f >nul 2>&1
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v ContentDeliveryAllowed /t REG_DWORD /d 0 /f >nul 2>&1
|
||||
:: Disable suggestions in Settings
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement" /v ScoobeSystemSettingEnabled /t REG_DWORD /d 0 /f >nul 2>&1
|
||||
:: Disable tips and tailored experiences
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SubscribedContent-338393Enabled /t REG_DWORD /d 0 /f >nul 2>&1
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Privacy" /v TailoredExperiencesWithDiagnosticDataEnabled /t REG_DWORD /d 0 /f >nul 2>&1
|
||||
:: Disable suggested content (apps like Candy Crush)
|
||||
reg add "HKLM\Software\Policies\Microsoft\Windows\CloudContent" /v DisableConsumerFeatures /t REG_DWORD /d 1 /f >nul 2>&1
|
||||
:: Disable ads in File Explorer
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSyncProviderNotifications /t REG_DWORD /d 0 /f >nul 2>&1
|
||||
:: Disable Windows welcome experience
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SubscribedContent-310093Enabled /t REG_DWORD /d 0 /f >nul 2>&1
|
||||
|
||||
echo Disabling Copilot
|
||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot" /v TurnOffWindowsCopilot /t REG_DWORD /d 1 /f >nul 2>&1
|
||||
)
|
||||
|
||||
choice /C yn /M "Mimic Windows 10 user interface on Windows 11?"
|
||||
if %ERRORLEVEL% EQU 1 (
|
||||
:: Enable classic file explorer look
|
||||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell\Update\Packages" /v UndockingDisabled /t REG_DWORD /d 0 /f >nul 2>&1
|
||||
:: Startmenu to the left
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarAl /t REG_DWORD /d 0 /f >nul 2>&1
|
||||
)
|
||||
|
||||
choice /C yn /M "Enable changes by restarting explorer?"
|
||||
if %ERRORLEVEL% EQU 1 (
|
||||
taskkill /f /im explorer.exe && start explorer.exe
|
||||
)
|
||||
|
||||
echo.
|
||||
echo All done!
|
||||
popd
|
||||
|
Loading…
x
Reference in New Issue
Block a user