Skip to content

Commit

Permalink
Update sort method
Browse files Browse the repository at this point in the history
  • Loading branch information
BiteDasher committed May 12, 2020
1 parent 1c0e660 commit 2b5249f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wifiman
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ EOF
chmod +x /etc/wifiman0/"${essid_name}"/bashconf.sh
if ! [ $REWRITE ]; then
if [ "$(ls /etc/wifiman0 | wc -l)" == 1 ]; then touch /etc/wifiman0/"${essid_name}"/id1+; ln -s /etc/wifiman0/"${essid_name}" /etc/wifiman0/.ids/id1; else
ln -s /etc/wifiman0/"${essid_name}" /etc/wifiman0/.ids/$(ls --sort version /etc/wifiman0/*/id*+ | tac | rev | cut -c2-999 | cut -d"/" -f 1 | rev | cut -c3-999 | sort -M | tac | paste -sd " " | echo "id$(($(cut -d" " -f 1)+1))")
touch /etc/wifiman0/"${essid_name}"/$(ls --sort version /etc/wifiman0/*/id*+ | tac | rev | cut -c2-999 | cut -d"/" -f 1 | rev | cut -c3-999 | sort -M | tac | paste -sd " " | echo "id$(($(cut -d" " -f 1)+1))+")
ln -s /etc/wifiman0/"${essid_name}" /etc/wifiman0/.ids/$(ls --sort version /etc/wifiman0/*/id*+ | tac | rev | cut -c2-999 | cut -d"/" -f 1 | rev | cut -c3-999 | sort -V | tac | paste -sd " " | echo "id$(($(cut -d" " -f 1)+1))")
touch /etc/wifiman0/"${essid_name}"/$(ls --sort version /etc/wifiman0/*/id*+ | tac | rev | cut -c2-999 | cut -d"/" -f 1 | rev | cut -c3-999 | sort -V | tac | paste -sd " " | echo "id$(($(cut -d" " -f 1)+1))+")
fi; fi
unset REWRITE
echo -e "\033[1;32mConfiguration file created.\033[0m"
Expand Down Expand Up @@ -212,8 +212,8 @@ EOF
chmod +x /etc/wifiman0/"${essid_name}"/bashconf.sh
if ! [ $REWRITE ]; then
if [ "$(ls /etc/wifiman0 | wc -l)" == 1 ]; then touch /etc/wifiman0/"${essid_name}"/id1+; ln -s /etc/wifiman0/"${essid_name}" /etc/wifiman0/.ids/id1; else
ln -s /etc/wifiman0/"${essid_name}" /etc/wifiman0/.ids/$(ls --sort version /etc/wifiman0/*/id*+ | tac | rev | cut -c2-999 | cut -d"/" -f 1 | rev | cut -c3-999 | sort -M | tac | paste -sd " " | echo "id$(($(cut -d" " -f 1)+1))")
touch /etc/wifiman0/"${essid_name}"/$(ls --sort version /etc/wifiman0/*/id*+ | tac | rev | cut -c2-999 | cut -d"/" -f 1 | rev | cut -c3-999 | sort -M | tac | paste -sd " " | echo "id$(($(cut -d" " -f 1)+1))+")
ln -s /etc/wifiman0/"${essid_name}" /etc/wifiman0/.ids/$(ls --sort version /etc/wifiman0/*/id*+ | tac | rev | cut -c2-999 | cut -d"/" -f 1 | rev | cut -c3-999 | sort -V | tac | paste -sd " " | echo "id$(($(cut -d" " -f 1)+1))")
touch /etc/wifiman0/"${essid_name}"/$(ls --sort version /etc/wifiman0/*/id*+ | tac | rev | cut -c2-999 | cut -d"/" -f 1 | rev | cut -c3-999 | sort -V | tac | paste -sd " " | echo "id$(($(cut -d" " -f 1)+1))+")
fi; fi
unset REWRITE
echo -e "\033[1;32mConfiguration file created.\033[0m"
Expand Down

0 comments on commit 2b5249f

Please sign in to comment.