Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INSERT INTO radcheck(id, username, attribute, op, value) VALUES (,,00:23:32:c2:a9:e8,Auth-Type,:=,Accept);
- INSERT INTO radcheck(id, username, attribute, op, value) VALUES (,'','00:23:32:c2:a9:e8','Auth-Type',':=','Accept');
- #!/bin/bash
- ssh ubnt@xxx.xxx.xxx.xxx brmacs >>MACS.txt mv MACS.txt /etc/persistent scp mhalls@xxx.xxx.xxx.xxx:/etc/persistent/MACS.txt MACS.txt
- sed -i "1d" MACS.txt
- head -c 58 MACS.txt >>shortmacs.txt
- tail -c 18 shortmacs.txt >>usermac.txt
- sed 's/"//g' usermac.txt >>usermacrdy.txt
- sed -i 's/^/INSERT INTO `radcheck`(`id`, `username`, `attribute`, `op`, `value`) VALUES (,'',/' usermacrdy.txt
- sed "s/$/','Auth-Type',':=','Accept');/" usermacrdy.txt > sqlquery.txt
- sed -i "s/,,/,'','/" sqlquery.txt
- rm -f MACS.txt
- rm -f shortmacs.txt
- rm -f usermac.txt
- rm -f usermacrdy.txt
- sed -i 's/^/INSERT INTO `radcheck`(`username`, `attribute`, `op`, `value`) VALUES (/' usermacrdy.txt
- sed "s/$/','Auth-Type',':=','Accept');/" usermacrdy.txt > sqlquery.txt
- sed -i "s/,'','//" sqlquery.txt
- $ sed -r 's/,([^ ),]+)/,'''1'''/g; s/,,/,'''',/g' file
- INSERT INTO radcheck(id, username, attribute, op, value) VALUES (,'','00:23:32:c2:a9:e8','Auth-Type',':=','Accept');
- $ sed -r "s/,([^ ),]+)/,'1'/g; s/,,/,'',/g" file
- INSERT INTO radcheck(id, username, attribute, op, value) VALUES (,'','00:23:32:c2:a9:e8','Auth-Type',':=','Accept');
- $ cat script.sed
- s/,([^ ),]+)/,'1'/g
- s/,,/,'',/g
- $ sed -rf script.sed file
- INSERT INTO radcheck(id, username, attribute, op, value) VALUES (,'','00:23:32:c2:a9:e8','Auth-Type',':=','Accept');
- sed -E -e "s/,([^ ),]+)/,'1'/g" -e "s/,,/,'',/g" file
- $ cat file3
- INSERT INTO radcheck(username, attribute, op, value) VALUES (00:23:32:c2:a9:e8,'Auth-Type',':=','Accept');
- $ sed -r "s/(([[:xdigit:]:]+)/('1'/" file3
- INSERT INTO radcheck(username, attribute, op, value) VALUES ('00:23:32:c2:a9:e8','Auth-Type',':=','Accept');
- sed "s/(([^)]*)[^,]*){0,1},([^,)]*)/1,'2'/g
- " <<IN
- INSERT INTO radcheck(id, username, attribute, op, value) VALUES (,,00:23:32:c2:a9:e8,Auth-Type,:=,Accept);
- INSERT INTO radcheck(id, username, attribute, op, value) VALUES (,'','00:23:32:c2:a9:e8','Auth-Type',':=','Accept');
- INSERT INTO radcheck(id, username, attribute, op, value) VALUES (,'','00:23:32:c2:a9:e8','Auth-Type',':=','Accept');INSERT INTO radcheck(id, username, attribute, op, value) VALUES (,'','00:23:32:c2:a9:e8','Auth-Type',':=','Accept');INSERT INTO radcheck(id, username, attribute, op, value) VALUES (,'','00:23:32:c2:a9:e8','Auth-Type',':=','Accept');
Add Comment
Please, Sign In to add comment