Advertisement
vasil_k_k

Custom Wi-Fi adapter config

Feb 6th, 2025 (edited)
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.11 KB | None | 0 0
  1. #!/bin/ash
  2.  
  3. iwconfig wlan0
  4. sleep 2
  5.  
  6. echo "Choose an option:"
  7. echo "1) Restart the web service"
  8. echo "2) Connect to another Wi-Fi network"
  9. read -p "Enter your choice (1 or 2): " choice
  10.  
  11. if [ "$choice" -eq 1 ]; then
  12.     echo  
  13.     echo "Restarting networking service..."
  14.     doas rc-service networking restart
  15.     sleep 2    
  16.     exit 0
  17.  
  18. elif [ "$choice" -eq 2 ]; then
  19.     echo
  20.     echo "Setting up your Wi-Fi network..."
  21.     sleep 2
  22.     echo
  23.     read -p "Enter the Wi-Fi name: " name
  24.     read -p "Enter the password: " password
  25.     echo
  26.  
  27.     echo "Configuring Wi-Fi..."
  28.  
  29.     if [ -z "$password" ]; then
  30.      echo -e "network={\n    ssid=\"$name\"\n    key_mgmt=NONE\n}" > ./wpa_supplicant.conf
  31.     else
  32.         wpa_passphrase $name $password > ./wpa_supplicant.conf
  33.     fi
  34.      doas mv ./wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf
  35.      doas rc-service wpa_supplicant restart
  36.      doas rc-service networking restart
  37.      sleep 3  
  38. fi
  39.  
  40.  
  41. #!/bin/ash
  42.  
  43. xfce4-terminal --hold -e "mednafen '$1'"
  44.  
  45.  
  46. #!/bin/ash
  47.  
  48. setxkbmap -layout us,bg -variant ,phonetic -option 'grp:alt_shift_toggle'
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement