smb
This commit is contained in:
parent
03e4565a68
commit
d0d779e3b5
28
bin/smb
Executable file
28
bin/smb
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
|
||||
export SMBPATH="smb.txt"
|
||||
|
||||
export SMBID=$RANDOM
|
||||
|
||||
echo "welcome to smb"
|
||||
|
||||
if [[ ! -f $SMBPATH ]];then
|
||||
read -p "Initilize smb in $SMBPATH ? "
|
||||
echo "--top--" >> $SMBPATH
|
||||
fi
|
||||
|
||||
read -p "title your post: " TITLE
|
||||
|
||||
mkdir /tmp/smb/$USER/ -p
|
||||
vim /tmp/smb/$USER/$SMBID
|
||||
if [[ -f "/tmp/smb/$USER/$SMBID" ]];then
|
||||
echo "====================================================" >> /tmp/smb/$USER/$SMBID.t
|
||||
echo "Title: $TITLE" >> /tmp/smb/$USER/$SMBID.t
|
||||
date "+Posted on: %d %b, %Y\\" | tr '\\\\' "\n" >> /tmp/smb/$USER/$SMBID.t
|
||||
cat /tmp/smb/$USER/$SMBID >> /tmp/smb/$USER/$SMBID.t
|
||||
echo -e "====================================================\n\n" >> /tmp/smb/$USER/$SMBID.t
|
||||
sed -i "/--top--/r /tmp/smb/$USER/$SMBID.t" $SMBPATH
|
||||
else
|
||||
echo "aborting..."
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user